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

Bug#498897: lintian: check for packages superseded by the perl core



Package: lintian
Severity: wishlist
Tags: patch

Now that we have the data about packages provided by the perl core,
here's a check for unnecessary separate packages.

The paragraph about alternative dependencies in the description is
a bit redundant, but I thought I'd err on the verbose side.

This currently triggers on at least libmodule-build-perl (#480727)
and libparams-check-perl (#498459).
-- 
Niko Tyni   ntyni@debian.org
>From f754142556f1135a026c7aee95f50dfedf47dee4 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 14 Sep 2008 12:51:56 +0300
Subject: [PATCH] Check for packages also provided by the perl core with at least the same version.

---
 checks/fields      |    6 ++++++
 checks/fields.desc |   21 +++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/checks/fields b/checks/fields
index 07895be..13161ff 100644
--- a/checks/fields
+++ b/checks/fields
@@ -187,6 +187,12 @@ if (not defined $info->field('version')) {
 		if ($version =~ /\+b\d+$/ && $type eq "source") {
 			tag "binary-nmu-debian-revision-in-source", "$version";
 		}
+		my $name = $info->field('package');
+		if ($name && $perl_core_provides->known($name) &&
+		    perl_core_has_version($name, '>=', $upstream)) {
+			my $core_version = $perl_core_provides->value($name);
+			tag "package-superseded-by-perl", "with $core_version"
+		}
 	} else {
 		tag "bad-version-number", "$version";
 	}
diff --git a/checks/fields.desc b/checks/fields.desc
index 54b18e5..f62c5a1 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1014,3 +1014,24 @@ Info: This package declares an unnecessary versioned dependency
  Example: perl-modules (&gt;= 5.10.0) | libmodule-build-perl (&gt;= 0.26)
 Ref: policy 7.5
 
+Tag: package-superseded-by-perl
+Type: warning
+Severity: normal
+Certainty: certain
+Info: This package is also provided by one of the Perl core packages
+ (perl, perl-base, perl-modules), and the core version is at least
+ as new as this one.
+ .
+ The package should either be upgraded to a newer upstream version
+ or removed from the archive as unnecessary. In the removal case, any
+ versioned dependencies on this package must first be changed to include
+ the Perl core package (because versioned dependencies are not satisfied
+ by provided packages).
+ .
+ The recommended way to express the dependency without needless
+ complications on backporting packages is to use alternative dependencies.
+ The Perl core package should be the preferred alternative and the
+ versioned dependency a secondary one.
+ .
+ Example: perl-modules (&gt;= 5.10.0) | libmodule-build-perl (&gt;= 0.26)
+Ref: policy 7.5
-- 
1.5.6.5


Reply to: