[Fai-commit] r6650 - trunk

Michael Tautschnig mt at alioth.debian.org
Tue Sep 6 17:25:21 UTC 2011


Author: mt
Date: 2011-09-06 17:25:20 +0000 (Tue, 06 Sep 2011)
New Revision: 6650

Modified:
   trunk/Makefile
Log:
Make shell syntax checks work again

- checkbashisms without -f will exit with error 2 for bash scripts
- shopt -s extglob won't be evaluated by bash -n


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2011-09-06 16:36:23 UTC (rev 6649)
+++ trunk/Makefile	2011-09-06 17:25:20 UTC (rev 6650)
@@ -28,7 +28,9 @@
 		echo -n "Checking for bashisms"; \
 		for SCRIPT in $(SHELL_SCRIPTS); do \
 			test -r $${SCRIPT} || continue ; \
-			checkbashisms -x $${SCRIPT} || exit ; \
+			ec=0
+			checkbashisms -x $${SCRIPT} || ec=$$? ; \
+			if [ $${ec} -ne 0 ] && [ $${ec} -ne 2 ] ; then exit $${ec} ; fi ; \
 			echo -n "."; \
 		done; \
 		echo " done."; \
@@ -44,7 +46,7 @@
 	@echo -n "Checking for shell syntax errors"; \
 	for SCRIPT in $(BASH_SCRIPTS) $(SHELL_SCRIPTS); do \
 		test -r $${SCRIPT} || continue ; \
-		bash -n $${SCRIPT} || exit ; \
+		bash -O extglob -n $${SCRIPT} || exit ; \
 		echo -n "."; \
 	done; \
 	echo " done."; \




More information about the Fai-commit mailing list