[QGIS Commit] r9219 - trunk/qgis/scripts

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Aug 30 11:20:16 EDT 2008


Author: jef
Date: 2008-08-30 11:20:16 -0400 (Sat, 30 Aug 2008)
New Revision: 9219

Modified:
   trunk/qgis/scripts/astyle-all.sh
   trunk/qgis/scripts/astyle.sh
   trunk/qgis/scripts/prepare-commit.sh
   trunk/qgis/scripts/update-indent.sh
Log:
update identation scripts

Modified: trunk/qgis/scripts/astyle-all.sh
===================================================================
--- trunk/qgis/scripts/astyle-all.sh	2008-08-30 14:53:45 UTC (rev 9218)
+++ trunk/qgis/scripts/astyle-all.sh	2008-08-30 15:20:16 UTC (rev 9219)
@@ -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
 

Modified: trunk/qgis/scripts/astyle.sh
===================================================================
--- trunk/qgis/scripts/astyle.sh	2008-08-30 14:53:45 UTC (rev 9218)
+++ trunk/qgis/scripts/astyle.sh	2008-08-30 15:20:16 UTC (rev 9219)
@@ -1,10 +1,16 @@
 #!/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
 
 export ARTISTIC_STYLE_OPTIONS="\
@@ -23,8 +29,6 @@
 --min-conditional-indent=-1 \
 --suffix=none"
 
-#--break-blocks \
-
 export ARTISTIC_STYLE_OPTIONS="\
 $ARTISTIC_STYLE_OPTIONS \
 --pad=oper \
@@ -32,7 +36,12 @@
 --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

Modified: trunk/qgis/scripts/prepare-commit.sh
===================================================================
--- trunk/qgis/scripts/prepare-commit.sh	2008-08-30 14:53:45 UTC (rev 9218)
+++ trunk/qgis/scripts/prepare-commit.sh	2008-08-30 15:20:16 UTC (rev 9219)
@@ -1,9 +1,19 @@
 #!/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
 
 # determine changed files

Modified: trunk/qgis/scripts/update-indent.sh
===================================================================
--- trunk/qgis/scripts/update-indent.sh	2008-08-30 14:53:45 UTC (rev 9218)
+++ trunk/qgis/scripts/update-indent.sh	2008-08-30 15:20:16 UTC (rev 9219)
@@ -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
@@ -23,7 +27,6 @@
 ASTYLEDIFF=astyle.r$REV0-r$REV1.diff
 >$ASTYLEDIFF
 
-
 # reformat
 for f in $MODIFIED; do
 	case "$f" in
@@ -35,6 +38,11 @@
                 ;;
         esac
 
+	if ! [ -s $f ]; then
+		# deleted
+	 	continue
+	fi
+
         m=$f.r$REV1.prepare
 
 	cp $f $m



More information about the QGIS-commit mailing list