From: Michael Prokop Date: Tue, 29 Jul 2014 19:30:58 +0000 (+0200) Subject: Provide 'make shellcheck' for syntax checks, enable during package build X-Git-Tag: v0.66~5 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=cd8a1e58531fbc46b89630896f796b7d0e42b47e Provide 'make shellcheck' for syntax checks, enable during package build While at it drop the deprecated 'make online' target. --- diff --git a/Makefile b/Makefile index 70cca32..8fe138b 100644 --- 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 diff --git a/debian/control b/debian/control index 2ba6af8..137273c 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Grml Team Uploaders: Michael Prokop , Alexander Wirt , Christian Hofstaedtler , Ulrich Dangel 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 diff --git a/debian/rules b/debian/rules index 2356986..9e501f5 100755 --- a/debian/rules +++ b/debian/rules @@ -18,6 +18,7 @@ build-indep: build-stamp build-stamp: dh_testdir (cd tests && ./run_tests.sh) + make shellcheck make touch $@