summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-17 21:34:30 -0400
committerDave Reisner <dreisner@archlinux.org>2012-04-24 09:54:06 -0400
commit03acea832ad39fa371781f045c39677a02d1156a (patch)
tree488c4e385749f0f08ac2286a250095048af7435e
parent1b494ab77198a6cbb9c06a13435159641e2dc0c5 (diff)
validate bash scripts with 'bash -n' during build.
Use the no-exec mode of $(BASH_SHELL) to check for syntax errors in shell scripts. Since we use the extglob feature in various places, this requires that we pass -O extglob to the shell as well, to ensure that the parser is armed to handle this syntax. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--contrib/Makefile.am1
-rw-r--r--scripts/Makefile.am1
2 files changed, 2 insertions, 0 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 5139b54d..3cc1e578 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -66,6 +66,7 @@ $(BASHSCRIPTS): Makefile
$(AM_V_at)$(RM) $@
$(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
$(AM_V_at)chmod +x,a-w $@
+ @$(BASH_SHELL) -O extglob -n $@
$(OURFILES): Makefile
$(AM_V_at)$(RM) $@ $@.tmp
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index b8a19900..06e9095e 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -64,6 +64,7 @@ $(OURSCRIPTS): Makefile
$(AM_V_at)$(RM) $@
$(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
$(AM_V_at)chmod +x,a-w $@
+ @$(BASH_SHELL) -O extglob -n $@
makepkg: \
$(srcdir)/makepkg.sh.in \