The following commit has been merged in the master branch:
commit ec1944cbdf4d65cf8a2e0125c327df2b39d62b2d
Author: Raphael Geissert <[email protected]>
Date:   Fri Jan 1 18:56:25 2010 -0600

    Recognise the 'test' command on the -sourcing-without-test check

diff --git a/checks/init.d b/checks/init.d
index 7de3a36..7982446 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -238,7 +238,7 @@ sub check_init {
 
        # Pretty dummy way to handle conditionals, but should be enough
        # for simple init scripts
-       $in_file_test = 1 if ($l =~ m/\bif\s+.*?\[\s+-[efr]\s+/);
+       $in_file_test = 1 if ($l =~ m/\bif\s+.*?(?:test|\[)\s+-[efr]\s+/);
        $in_file_test = 0 if ($l =~ m/\bfi\b/);
        if (!$in_file_test && $l =~ m,^\s*\.\s+["'"]?(/etc/default/[\$\w/-]+),) 
{
            tag "init.d-script-sourcing-without-test", "/etc/init.d/$_:$. $1";
diff --git a/debian/changelog b/debian/changelog
index be18a02..2515337 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,9 +33,9 @@ lintian (2.3.1) UNRELEASED; urgency=low
     + [RG] Warn about init scripts with incomplete start runlevels.
     + [RG] Tighten check for missing dependency on local_fs or remote_fs
       when using files with a name of 'var*' or 'usr*'.
-    + [RG] Also recognise the use of the -r test as a file test when
-      determining whether a /etc/default file is being sourced
-      unconditionally.
+    + [RG] Also recognise the use of the -r test as a file test, and
+      the test command when determining whether a /etc/default file is
+      being sourced unconditionally.
     + [RG] Correct the description of the
       missing-dependency-on-{remote,local_fs} tags where 'is' was meant
       to be used instead of 'are'.
diff --git 
a/t/tests/init.d-general/debian/debian/init.d-general-sourcing-without-test.init
 
b/t/tests/init.d-general/debian/debian/init.d-general-sourcing-without-test.init
index 9a7432e..1b946e3 100644
--- 
a/t/tests/init.d-general/debian/debian/init.d-general-sourcing-without-test.init
+++ 
b/t/tests/init.d-general/debian/debian/init.d-general-sourcing-without-test.init
@@ -36,3 +36,7 @@ PACKAGE=moo
 if [ -f /etc/default/$PACKAGE ]; then
     . /etc/default/$PACKAGE
 fi
+
+if test -f /etc/default/$PACKAGE; then
+    . /etc/default/$PACKAGE
+fi

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to