[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: Correct false positives in unconditional-use-of-dpkg-statoverride by detecting "if !" as a valid shell prefix. (Closes: #869587)



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit a8e584ff5b357aa5c6887a520b2a7993f401c129
Author: Chris Lamb <lamby@debian.org>
Date:   Mon Jul 24 22:11:28 2017 +0100

    Correct false positives in unconditional-use-of-dpkg-statoverride by detecting "if !" as a valid shell prefix. (Closes: #869587)
---
 checks/scripts.pm                                           |  2 +-
 debian/changelog                                            |  5 +++++
 .../debian/debian/preinst                                   | 13 +++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/checks/scripts.pm b/checks/scripts.pm
index 1aff985..9540dc5 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -85,7 +85,7 @@ my $VERSIONED_INTERPRETERS
 # beginning of the command rather than checking whether the command is at the
 # beginning of a line.
 my $LEADINSTR
-  = '(?:(?:^|[`&;(|{])\s*|(?:if|then|do|while)\s+|env(?:\s+[[:alnum:]_]+=(?:\S+|\"[^"]*\"|\'[^\']*\'))*\s+)';
+  = '(?:(?:^|[`&;(|{])\s*|(?:if|then|do|while|!)\s+|env(?:\s+[[:alnum:]_]+=(?:\S+|\"[^"]*\"|\'[^\']*\'))*\s+)';
 my $LEADIN = qr/$LEADINSTR/;
 
 #forbidden command in maintainer scripts
diff --git a/debian/changelog b/debian/changelog
index 1f9c3ae..94784cc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,11 @@ lintian (2.5.53) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
+  * checks/scripts.pm:
+    + [CL] Correct false positives in
+      unconditional-use-of-dpkg-statoverride by detecting "if !" as a
+      valid shell prefix.  (Closes: #869587)
+
   * commands/lintian.pm:
     + [CL] Apply patch from Maia Everett to avoid British spelling when
       using en_US locale.  (Closes: #868897)
diff --git a/t/tests/scripts-unconditional-use-of-dpkg-statoverride/debian/debian/preinst b/t/tests/scripts-unconditional-use-of-dpkg-statoverride/debian/debian/preinst
new file mode 100644
index 0000000..7c00d9c
--- /dev/null
+++ b/t/tests/scripts-unconditional-use-of-dpkg-statoverride/debian/debian/preinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+# Conditional use of dpkg-statoverride --add
+if ! dpkg-statoverride --list /usr/bin/crontab >/dev/null 2>&1
+then
+	dpkg-statoverride --update --add root crontab 2755 /usr/bin/crontab
+fi
+
+exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: