Provide 'make shellcheck' for syntax checks, enable during package build
authorMichael Prokop <mika@grml.org>
Tue, 29 Jul 2014 19:30:58 +0000 (21:30 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 29 Jul 2014 19:37:27 +0000 (21:37 +0200)
While at it drop the deprecated 'make online' target.

Makefile
debian/control
debian/rules

index 70cca32..8fe138b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,7 @@
+BASH_SCRIPTS = grml-debootstrap
+SHELL_SCRIPTS = chroot-script
+MKSH_SCRIPTS = bootgrub.mksh
+
 all: doc
 
 doc: doc_man doc_html
@@ -17,10 +21,24 @@ man-stamp: grml-debootstrap.8.txt
        xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl grml-debootstrap.8.xml
        touch man-stamp
 
-online: all
-       scp grml-debootstrap.8.html grml:/var/www/grml/grml-debootstrap/index.html
-       scp images/icons/*          grml:/var/www/grml/grml-debootstrap/images/icons/
-       scp images/screenshot.png   grml:/var/www/grml/grml-debootstrap/images/
+shellcheck:
+       @echo -n "Checking for shell syntax errors"; \
+       for SCRIPT in $(SHELL_SCRIPTS); do \
+               test -r $${SCRIPT} || continue ; \
+               sh -n $${SCRIPT} || exit ; \
+               echo -n "."; \
+       done; \
+       for SCRIPT in $(BASH_SCRIPTS) ; do \
+               test -r $${SCRIPT} || continue ; \
+               bash -n $${SCRIPT} || exit ; \
+               echo -n "."; \
+       done; \
+       for SCRIPT in $(MKSH_SCRIPTS) ; do \
+               test -r $${SCRIPT} || continue ; \
+               mksh -n $${SCRIPT} || exit ; \
+               echo -n "."; \
+       done; \
+       echo " done."
 
 clean:
        rm -rf grml-debootstrap.8.html grml-debootstrap.8.xml grml-debootstrap.8 html-stamp man-stamp
index 2ba6af8..137273c 100644 (file)
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Grml Team <team@grml.org>
 Uploaders: Michael Prokop <mika@debian.org>, Alexander Wirt <formorer@debian.org>, Christian Hofstaedtler <christian@hofstaedtler.name>, Ulrich Dangel <mru@spamt.net>
 Build-Depends: debhelper (>= 5)
-Build-Depends-Indep: asciidoc, docbook-xsl, xsltproc, shunit2
+Build-Depends-Indep: asciidoc, docbook-xsl, xsltproc, shunit2, mksh
 Standards-Version: 3.9.5
 Homepage: http://grml.org/grml-debootstrap/
 Vcs-git: git://git.grml.org/grml-debootstrap.git
index 2356986..9e501f5 100755 (executable)
@@ -18,6 +18,7 @@ build-indep: build-stamp
 build-stamp:
        dh_testdir
        (cd tests && ./run_tests.sh)
+       make shellcheck
        make
        touch $@