[pacman-dev] [PATCH 7/8] validate shell scripts with $(BASH_SHELL) on build

Dave Reisner dreisner at archlinux.org
Thu Apr 12 10:54:37 EDT 2012


Pass $(OURSCRIPTS) through the bash parser in read only mode to validate
syntax. Note that this doesn't actually catch all errors, but it might
be useful for developers working on these scripts.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 contrib/Makefile.am |    1 +
 scripts/Makefile.am |    1 +
 2 files changed, 2 insertions(+)

diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index eca39e7..2953912 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -55,6 +55,7 @@ $(OURSCRIPTS): Makefile
 	$(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp
 	$(AM_V_at)chmod +x,a-w $@.tmp
 	$(AM_V_at)mv $@.tmp $@
+	@$(BASH_SHELL) -O extglob -n $@
 
 $(OURFILES): Makefile
 	$(AM_V_at)$(RM) $@ $@.tmp
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index b8a1990..dbe61b8 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -63,6 +63,7 @@ edit = sed \
 $(OURSCRIPTS): Makefile
 	$(AM_V_at)$(RM) $@
 	$(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
+	@$(BASH_SHELL) -O extglob -n $@
 	$(AM_V_at)chmod +x,a-w $@
 
 makepkg: \
-- 
1.7.10



More information about the pacman-dev mailing list