[SCM] Debian package checker branch, master, updated. 2.2.12-23-gccef6dd
The following commit has been merged in the master branch:
commit ccef6dd3458579bd7a3eeb25b7907ac1f14b9bdf
Author: Russ Allbery <rra@debian.org>
Date: Mon Jun 29 22:43:59 2009 -0700
Parse redirects after diversions in maintainer scripts
* checks/scripts{,.desc}:
+ [RA] Allow for output redirection when parsing diversions in
maintainer scripts. Thanks, Andreas Beckmann. (Closes: #534942)
diff --git a/checks/scripts b/checks/scripts
index df77617..18c8067 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -897,10 +897,10 @@ while (<SCRIPTS>) {
# position after the last pair of quotation marks, if any
while($divert =~ m/\G.*?("|').+?\1/gc) {} #"
- # Strip anything matching and after '&&', '||', or ';'
+ # Strip anything matching and after '&&', '||', ';', or '>'
# this is safe only after we are positioned after the last pair
# of quotation marks
- $divert =~ s/\G.+?\K(?: && | \|\| | ;).*$//x;
+ $divert =~ s/\G.+?\K(?: && | \|\| | ; | \d*> ).*$//x;
pos($divert) = undef;
# Remove quotation marks, they affect:
# * our var to regex trick
diff --git a/debian/changelog b/debian/changelog
index 277df39..d3e5413 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,9 +31,11 @@ lintian (2.2.13) UNRELEASED; urgency=low
* checks/patch-systems:
+ [RA] Don't include the package name as extra data in tags that are
only issued for source packages. Patch from Raphael Geissert.
- * checks/scripts.desc:
+ * checks/scripts{,.desc}:
+ [RA] Lower certainty of read-in-maintainer-script to possible and
mention false positives. Thanks, Raphaël Hertzog. (Closes: #534276)
+ + [RA] Allow for output redirection when parsing diversions in
+ maintainer scripts. Thanks, Andreas Beckmann. (Closes: #534942)
* collection/strings:
+ [ADB] Handle the fact that, when Lintian is run as root, the output of
diff --git a/t/tests/scripts-diversions/debian/debian/preinst b/t/tests/scripts-diversions/debian/debian/preinst
index 0c87031..9bc2f71 100644
--- a/t/tests/scripts-diversions/debian/debian/preinst
+++ b/t/tests/scripts-diversions/debian/debian/preinst
@@ -15,10 +15,16 @@ if [ install = "$1" ]; then
dpkg-divert --add --divert /usr/share/scripts/another-file.real \
/usr/share/scripts/another-file
- # This is also correct, but we're not going to clean it up.
+ # This is also correct, but we're not going to clean it up. While we're
+ # at it, make sure we strip trailing redirections.
dpkg-divert --package scripts-diversions --add --rename \
--divert /usr/share/scripts/orphan.real \
- /usr/share/scripts/orphan
+ /usr/share/scripts/orphan > /dev/null
+
+ # The same one again, but with a different redirection.
+ dpkg-divert --package scripts-diversions --add --rename \
+ --divert /usr/share/scripts/orphan.real \
+ /usr/share/scripts/orphan 2> /dev/null
# This is broken because the file doesn't exist.
dpkg-divert --add --package scripts-diversions --rename \
diff --git a/t/tests/scripts-diversions/tags b/t/tests/scripts-diversions/tags
index 10cf291..e154dfe 100644
--- a/t/tests/scripts-diversions/tags
+++ b/t/tests/scripts-diversions/tags
@@ -1,4 +1,4 @@
-E: scripts-diversions: diversion-for-unknown-file usr/share/scripts/no-such-file preinst:26
+E: scripts-diversions: diversion-for-unknown-file usr/share/scripts/no-such-file preinst:32
E: scripts-diversions: orphaned-diversion usr/share/scripts/orphan preinst
E: scripts-diversions: package-uses-local-diversion preinst:12
E: scripts-diversions: package-uses-local-diversion preinst:16
--
Debian package checker
Reply to: