Skip to content

Commit fa0cde8

Browse files
author
jef
committed
update identation scripts
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9219 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b4dae98 commit fa0cde8

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

scripts/astyle-all.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/bin/bash
22

3-
if ! astyle.sh >/dev/null 2>&1; then
4-
echo astyle.sh not found in path >&2
5-
exit 1
6-
fi
3+
PATH=$PATH:$(dirname $0)
74

85
set -e
96

scripts/astyle.sh

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/bin/bash
22

3-
#if ! qgsloggermig.pl >/dev/null 2>&1; then
4-
# echo qgsloggermig.pl not found in path >&2
5-
# exit 1
6-
#fi
3+
if ! type -p astyle >/dev/null; then
4+
echo "astyle not found" >&2
5+
exit 1
6+
fi
7+
8+
if ! type -p flip >/dev/null; then
9+
flip() {
10+
:
11+
}
12+
fi
713

814
set -e
915

@@ -23,16 +29,19 @@ export ARTISTIC_STYLE_OPTIONS="\
2329
--min-conditional-indent=-1 \
2430
--suffix=none"
2531

26-
#--break-blocks \
27-
2832
export ARTISTIC_STYLE_OPTIONS="\
2933
$ARTISTIC_STYLE_OPTIONS \
3034
--pad=oper \
3135
--pad=paren-in \
3236
--unpad=paren"
3337

3438
for f in "$@"; do
35-
#flip -ub "$f"
36-
#qgsloggermig.pl "$f"
39+
if ! [ -f "$f" ]; then
40+
echo "$f not found" >&2
41+
continue
42+
fi
43+
44+
flip -ub "$f"
45+
#qgsloggermig.pl "$f"
3746
astyle $ARTISTIC_STYLE_OPTIONS "$f"
3847
done

scripts/prepare-commit.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
#!/bin/bash
22

3-
if ! [ -x astyle.sh ]; then
4-
PATH=$PATH:$(dirname $0)
3+
PATH=$PATH:$(dirname $0)
4+
5+
if ! type -p astyle.sh >/dev/null; then
6+
echo astyle.sh not found
7+
exit 1
8+
fi
9+
10+
if ! type -p colordiff >/dev/null; then
11+
colordiff()
12+
{
13+
cat "$@"
14+
}
515
fi
616

717
set -e

scripts/update-indent.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/bash
22

3-
if ! [ -x astyle.sh ]; then
4-
PATH=$PATH:$(dirname $0)
3+
PATH=$PATH:$(dirname $0)
4+
5+
if ! type -p colordiff >/dev/null; then
6+
colordiff() {
7+
cat "$@"
8+
}
59
fi
610

711
set -e
@@ -23,7 +27,6 @@ echo "Checking changes between $REV0 and $REV1"
2327
ASTYLEDIFF=astyle.r$REV0-r$REV1.diff
2428
>$ASTYLEDIFF
2529

26-
2730
# reformat
2831
for f in $MODIFIED; do
2932
case "$f" in
@@ -35,6 +38,11 @@ for f in $MODIFIED; do
3538
;;
3639
esac
3740

41+
if ! [ -s $f ]; then
42+
# deleted
43+
continue
44+
fi
45+
3846
m=$f.r$REV1.prepare
3947

4048
cp $f $m

0 commit comments

Comments
 (0)