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

[SCM] Debian package checker branch, master, updated. 2.5.14-64-ga76e7fe



The following commit has been merged in the master branch:
commit a76e7fed04ffaae72a47765fa4f56a135405f13b
Author: Niko Tyni <ntyni@debian.org>
Date:   Mon Jun 3 16:22:59 2013 +0300

    Fix 'package-superseded-by-perl' epoch handling
    
    The perl-provides data now includes epochs, so we have
    to take those into account when comparing the package version
    to the one in the Perl core.
    
    The test relies on the fact that libversion-perl currently has an epoch
    in the Debian archive. The old code would strip the test package epoch
    before the comparison, so 9:999 was falsely smaller than 1:0.8800.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/fields.pm b/checks/fields.pm
index 4d7a1bb..3a4ed9c 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -239,7 +239,8 @@ if (not defined $info->field('version')) {
     my $dversion = Dpkg::Version->new($version);
 
     if ($dversion->is_valid) {
-        my ($upstream, $debian) = ($dversion->version, $dversion->revision);
+        my ($epoch, $upstream, $debian) =
+            ($dversion->epoch, $dversion->version, $dversion->revision);
         # Dpkg::Version sets the debian revision to 0 if there is no revision.
         # - so we need to check if the raw version ends with "-0".
         tag 'debian-revision-should-not-be-zero', $version
@@ -291,7 +292,7 @@ if (not defined $info->field('version')) {
 
         my $name = $info->field('package');
         if ($name && $PERL_CORE_PROVIDES->known($name) &&
-                perl_core_has_version($name, '>=', $upstream)) {
+                perl_core_has_version($name, '>=', "$epoch:$upstream")) {
             my $core_version = $PERL_CORE_PROVIDES->value($name);
             tag 'package-superseded-by-perl', "with $core_version"
         }
diff --git a/debian/changelog b/debian/changelog
index 1dbb7fb..b8a9b28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,10 @@ lintian (2.5.15) UNRELEASED; urgency=low
     + [NT] Add final return to all subs in checks and ensure
       that the "run" sub complies with Lintian's own
       recommendation.
+  * checks/fields.pm:
+    + [NT] Apply patch from Niko Tyni to fix false-positive
+      package-superseded-by-perl for packages with epochs.
+      (Closes: #710919)
   * checks/manpages.{desc,pm}:
     + [NT] Apply patch from Bastien Roucariès to test for
       manpages named after their build path.
diff --git a/t/tests/fields-perl-provides/debian/debian/control.in b/t/tests/fields-perl-provides/debian/debian/control.in
index 07ef20b..235502a 100644
--- a/t/tests/fields-perl-provides/debian/debian/control.in
+++ b/t/tests/fields-perl-provides/debian/debian/control.in
@@ -15,3 +15,12 @@ Description: {$description}
  things.  It should not be installed like a regular package.  It may
  be an empty package.
 
+Package: libversion-perl
+Section: perl
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: another {$description}
+ This is another test package, designed to exercise epoch handling
+ in the 'package-superseded-by-perl' check. It is part of the Lintian
+ test suite and may do very odd things.  It should not be installed like
+ a regular package.  It may be an empty package.
diff --git a/t/tests/fields-perl-provides/debian/debian/rules b/t/tests/fields-perl-provides/debian/debian/rules
new file mode 100755
index 0000000..c965de0
--- /dev/null
+++ b/t/tests/fields-perl-provides/debian/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+%:
+	dh $@
+
+override_dh_gencontrol:
+	dh_gencontrol -plibversion-perl -- -v9:999
+	dh_gencontrol -i -Nlibversion-perl
+

-- 
Debian package checker


Reply to: