install_qa_check: make sure init.d and conf.d files do not have syntax errors in...
authorMike Frysinger <vapier@gentoo.org>
Tue, 23 Mar 2010 20:12:38 +0000 (20:12 -0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 23 Mar 2010 20:12:38 +0000 (20:12 -0000)
svn path=/main/trunk/; revision=15843

bin/misc-functions.sh

index 87aaeff5a9868d39ad87b3926cf61f9ab6174201..8db09a0e21b608a15a5b1df1cdab3845b15f320a 100755 (executable)
@@ -331,6 +331,15 @@ install_qa_check() {
                unset INSTALLTOD
        fi
 
+       # Sanity check syntax errors in init.d scripts
+       for d in /etc/conf.d /etc/init.d ; do
+               [[ -d ${D}/${d} ]] || continue
+               for i in "${D}"/${d}/* ; do
+                       [[ -L ${i} ]] && continue
+                       bash -n "${i}" || die "The init.d file has syntax errors: ${i}"
+               done
+       done
+
        # this should help to ensure that all (most?) shared libraries are executable
        # and that all libtool scripts / static libraries are not executable
        for i in "${D}"opt/*/lib{,32,64} \