Navigation Menu

Skip to content

Commit

Permalink
update identation scripts
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9219 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 30, 2008
1 parent 1e4e5fa commit 9598429
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 17 deletions.
5 changes: 1 addition & 4 deletions scripts/astyle-all.sh
@@ -1,9 +1,6 @@
#!/bin/bash

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

set -e

Expand Down
25 changes: 17 additions & 8 deletions scripts/astyle.sh
@@ -1,9 +1,15 @@
#!/bin/bash

#if ! qgsloggermig.pl >/dev/null 2>&1; then
# echo qgsloggermig.pl not found in path >&2
# exit 1
#fi
if ! type -p astyle >/dev/null; then
echo "astyle not found" >&2
exit 1
fi

if ! type -p flip >/dev/null; then
flip() {
:
}
fi

set -e

Expand All @@ -23,16 +29,19 @@ export ARTISTIC_STYLE_OPTIONS="\
--min-conditional-indent=-1 \
--suffix=none"

#--break-blocks \

export ARTISTIC_STYLE_OPTIONS="\
$ARTISTIC_STYLE_OPTIONS \
--pad=oper \
--pad=paren-in \
--unpad=paren"

for f in "$@"; do
#flip -ub "$f"
#qgsloggermig.pl "$f"
if ! [ -f "$f" ]; then
echo "$f not found" >&2
continue
fi

flip -ub "$f"
#qgsloggermig.pl "$f"
astyle $ARTISTIC_STYLE_OPTIONS "$f"
done
14 changes: 12 additions & 2 deletions scripts/prepare-commit.sh
@@ -1,7 +1,17 @@
#!/bin/bash

if ! [ -x astyle.sh ]; then
PATH=$PATH:$(dirname $0)
PATH=$PATH:$(dirname $0)

if ! type -p astyle.sh >/dev/null; then
echo astyle.sh not found
exit 1
fi

if ! type -p colordiff >/dev/null; then
colordiff()
{
cat "$@"
}
fi

set -e
Expand Down
14 changes: 11 additions & 3 deletions scripts/update-indent.sh
@@ -1,7 +1,11 @@
#!/bin/bash

if ! [ -x astyle.sh ]; then
PATH=$PATH:$(dirname $0)
PATH=$PATH:$(dirname $0)

if ! type -p colordiff >/dev/null; then
colordiff() {
cat "$@"
}
fi

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


# reformat
for f in $MODIFIED; do
case "$f" in
Expand All @@ -35,6 +38,11 @@ for f in $MODIFIED; do
;;
esac

if ! [ -s $f ]; then
# deleted
continue
fi

m=$f.r$REV1.prepare

cp $f $m
Expand Down

0 comments on commit 9598429

Please sign in to comment.