~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to scripts/astyle-all.sh

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
PATH=$PATH:$(dirname $0)
 
4
 
 
5
set -e
 
6
 
 
7
export elcr="$(tput el)$(tput cr)"
 
8
 
 
9
find src -type f -print | while read f; do
 
10
        case "$f" in
 
11
        src/core/spatialite/*)
 
12
                continue
 
13
                ;;
 
14
 
 
15
 
 
16
        *.cpp|*.h|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H)
 
17
                cmd=astyle.sh
 
18
                ;;
 
19
 
 
20
        *.ui|*.qgm|*.txt|*.t2t|*.py|*.sip|resources/context_help/*)
 
21
                cmd="flip -ub"
 
22
                ;;
 
23
 
 
24
 
 
25
        *)
 
26
                continue
 
27
                ;;
 
28
        esac
 
29
 
 
30
        if [ -f "$f.astyle" ]; then
 
31
                # reformat backup
 
32
                cp "$f.astyle" "$f"
 
33
                touch -r "$f.astyle" "$f"
 
34
        else
 
35
                # make backup
 
36
                cp "$f" "$f.astyle"
 
37
                touch -r "$f" "$f.astyle"
 
38
        fi
 
39
 
 
40
        echo -ne "Reformating $f $elcr"
 
41
        $cmd "$f"
 
42
done
 
43
 
 
44
echo