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

Bug#648532: lintian: perl4 tags emitted when following tag description advice



Package: lintian
Version: 2.5.3
Severity: normal
Tags: patch

Hi,

There was a bug in the checks I submitted earlier in the year for
the detection of perl 4 library use (bug#636994); the description
recommends adding an alternate dependency on
libperl4-corelibs-perl | perl (<< 5.12.3-7), but the tag is still
emitted if the package has this dependency.

I've attached two patches: one fixing the test cases, and one fixing
the checks.

Thanks,
Dominic.

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)
>From 0c594396160133b2896b78f30a48504fe9822e88 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Sat, 12 Nov 2011 16:08:25 +0000
Subject: [PATCH 1/2] Fix perl4 test cases to include an alternate dependency

Lintian's advice with this tag is to include a dependency on
libperl4-corelibs-perl | perl (<< 5.12.3-7), so update the test case
accordingly.
---
 .../debian/debian/control.in                       |    3 ++-
 .../debian/debian/control.in                       |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/tests/files-uses-perl4-libs-with-dep/debian/debian/control.in b/t/tests/files-uses-perl4-libs-with-dep/debian/debian/control.in
index 426e421..475f52a 100644
--- a/t/tests/files-uses-perl4-libs-with-dep/debian/debian/control.in
+++ b/t/tests/files-uses-perl4-libs-with-dep/debian/debian/control.in
@@ -7,7 +7,8 @@ Build-Depends: debhelper (>= 7.0.50~)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
-Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, libperl4-corelibs-perl
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\},
+ libperl4-corelibs-perl | perl (<< 5.12.3-7)
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
diff --git a/t/tests/scripts-uses-perl4-libs-with-dep/debian/debian/control.in b/t/tests/scripts-uses-perl4-libs-with-dep/debian/debian/control.in
index c5d2e1c..b3a9738 100644
--- a/t/tests/scripts-uses-perl4-libs-with-dep/debian/debian/control.in
+++ b/t/tests/scripts-uses-perl4-libs-with-dep/debian/debian/control.in
@@ -7,7 +7,8 @@ Build-Depends: debhelper (>= 7.0.50~), perl
 
 Package: {$srcpkg}
 Architecture: {$architecture}
-Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, libperl4-corelibs-perl
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\},
+ libperl4-corelibs-perl | perl (<< 5.12.3-7)
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
-- 
1.7.5.4

>From 322f9ec100abf97485f78ef7f149b62c9b2faa86 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Sat, 12 Nov 2011 16:09:50 +0000
Subject: [PATCH 2/2] In perl4 tests, allow alternative depedencies as
 recommended in tag description

---
 checks/files   |    2 +-
 checks/scripts |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/checks/files b/checks/files
index 432599e..3397d72 100644
--- a/checks/files
+++ b/checks/files
@@ -819,7 +819,7 @@ foreach my $file (@{$info->sorted_index}) {
     # we do the same check on perl scripts in checks/scripts
     {
         my $dep = $info->relation('strong');
-        if ($index_info->{type} =~ m/^[-h]/o && $file =~ m,\.pm$, && !$dep->implies('libperl4-corelibs-perl')) {
+        if ($index_info->{type} =~ m/^[-h]/o && $file =~ m,\.pm$, && !$dep->implies('libperl4-corelibs-perl') && !$dep->implies('libperl4-corelibs-perl | perl (<< 5.12.3-7)')) {
             open (PM, '<', $info->unpacked($file)) or fail("cannot open .pm file: $!");
             while (<PM>) {
                 if (/(?:do|require)\s+(?:'|")(abbrev|assert|bigfloat|bigint|bigrat|cacheout|complete|ctime|dotsh|exceptions|fastcwd|find|finddepth|flush|getcwd|getopt|getopts|hostname|importenv|look|newgetopt|open2|open3|pwd|shellwords|stat|syslog|tainted|termcap|timelocal|validate)\.pl(?:'|")/) {
diff --git a/checks/scripts b/checks/scripts
index 504d718..1d6a9d0 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -452,7 +452,8 @@ for my $filename (sort keys %{$info->scripts}) {
     }
 
     # Check for obsolete perl libraries
-    if ($base eq 'perl' && !$str_deps->implies('libperl4-corelibs-perl')) {
+    if ($base eq 'perl' && !$str_deps->implies('libperl4-corelibs-perl') &&
+        !$str_deps->implies('libperl4-corelibs-perl | perl (<< 5.12.3-7)')) {
         open(FH, '<', $path) or fail("could not open script $path");
         while (<FH>) {
             if (/(?:do|require)\s+(?:'|")(abbrev|assert|bigfloat|bigint|bigrat|cacheout|complete|ctime|dotsh|exceptions|fastcwd|find|finddepth|flush|getcwd|getopt|getopts|hostname|importenv|look|newgetopt|open2|open3|pwd|shellwords|stat|syslog|tainted|termcap|timelocal|validate)\.pl(?:'|")/) {
-- 
1.7.5.4


Reply to: