[SCM] Debian package checker branch, master, updated. 2.5.3-234-g776233f
The following commit has been merged in the master branch:
commit 776233fefc607ec8221bc577cd1c2ce99ba5e65f
Author: Niels Thykier <niels@thykier.net>
Date: Sun Nov 20 18:39:56 2011 +0100
Check that transitional packages are oldlibs/extra
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/checks/fields b/checks/fields
index 0a59d64..c01da40 100644
--- a/checks/fields
+++ b/checks/fields
@@ -448,6 +448,14 @@ if (not defined $info->field('section')) {
last;
}
}
+ if ($info->is_transitional) {
+ my $pri = $info->field ('priority')//'';
+ # Cannot use "unfold" as it could emit a tag for priority,
+ # which will be duplicated below.
+ $pri =~ s/\n//;
+ tag 'transitional-package-should-be-oldlibs-extra', "$parts[-1]/$pri"
+ unless $pri eq 'extra' && $parts[-1] eq 'oldlibs';
+ }
}
}
diff --git a/checks/fields.desc b/checks/fields.desc
index 7334b34..bcaae8b 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1077,3 +1077,13 @@ Info: The package build-depends on a versioned development package of
Should the package have a legitimate reason for using the versioned development
package, please add an override.
Ref: http://download.oracle.com/docs/cd/E17076_02/html/upgrading/upgrade_process.html
+
+Tag: transitional-package-should-be-oldlibs-extra
+Severity: normal
+Certainty: possible
+Ref: #645438
+Info: The package appears to be a transitional package, but it is not
+ priority extra and in the oldlibs section.
+ .
+ Using oldlibs/extra assists packages managers in handling the
+ transition package correctly.
diff --git a/checks/files b/checks/files
index e4206a2..5206d43 100644
--- a/checks/files
+++ b/checks/files
@@ -149,7 +149,7 @@ my @flash_nonfree = (
# transitional packages.
my @METAPKG_REGEX =
(qr/meta[ -]?package/, qr/dummy/,
- qr/(?:dependency|empty|transitional|virtual) package/);
+ qr/(?:dependency|empty|virtual) package/);
# Common files stored in /usr/share/doc/$pkg that aren't sufficient to
# consider the package non-empty.
@@ -214,9 +214,9 @@ my @devhelp_links;
my %x11_font_dirs;
# Check if package is empty
-my $is_dummy = 0;
+my $is_dummy = $info->is_transitional;
my $description = $info->field('description');
-if ($description) {
+if (!$is_dummy && $description) {
for my $regex (@METAPKG_REGEX) {
if ($description =~ /$regex/) {
$is_dummy = 1;
diff --git a/debian/changelog b/debian/changelog
index 10a4ac4..933511e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ lintian (2.5.4) UNRELEASED; urgency=low
- package-would-benefit-from-build-arch-targets
- python-depends-but-no-python-helper
- python3-depends-but-no-python3-helper
+ - transitional-package-should-be-oldlibs-extra
* checks/*:
+ [JW] Replace common_data.pm with Lintian::Check.
@@ -68,6 +69,9 @@ lintian (2.5.4) UNRELEASED; urgency=low
field" tag if they contain newlines.
+ [JW,NT] Clarified that build-depends-on-metapackage is not only
triggered by X11 metapackages. (Closes: #642125)
+ + [NT] Ensure transitional packages are in section oldlibs and
+ priority extra. Thanks to Josh Triplett for the report.
+ (Closes: #645438)
* checks/files{,.desc}:
+ [JW] Suggest the usage of "-delete" rather than "| xargs rm -f".
(Closes: #641983)
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index 19a6c51..4b42c68 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -310,6 +310,15 @@ sub relation {
return $self->{relation}->{$field};
}
+# Returns a truth value if the package appears to be transitional package.
+# - this is based on the package description.
+# sub is_transitional Needs-Info <>
+sub is_transitional {
+ my ($self) = @_;
+ my $desc = $self->field ('description')//'';
+ return $desc =~ m/transitional package/;
+}
+
=head1 NAME
Lintian::Collect::Binary - Lintian interface to binary package data collection
@@ -468,6 +477,13 @@ The concatenation of Recommends and Suggests.
If FIELD isn't present in the package, the returned Lintian::Relation
object will be empty (always satisfied and implies nothing).
+=item is_transitional
+
+Returns a truth value if the package appears to be a transitional
+package.
+
+This is based on the package's description.
+
=back
=head1 AUTHOR
diff --git a/t/tests/description-general/debian/debian/control.in b/t/tests/description-general/debian/debian/control.in
index 43e7b3f..db89089 100644
--- a/t/tests/description-general/debian/debian/control.in
+++ b/t/tests/description-general/debian/debian/control.in
@@ -67,6 +67,7 @@ Description: This description ends, etc.
be an empty package.
Package: {$srcpkg}-dummy
+Section: oldlibs
Architecture: {$architecture}
Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
Description: test package (transitional package)
diff --git a/t/tests/fields-transitional/debian/debian/control.in b/t/tests/fields-transitional/debian/debian/control.in
new file mode 100644
index 0000000..f2eb9da
--- /dev/null
+++ b/t/tests/fields-transitional/debian/debian/control.in
@@ -0,0 +1,14 @@
+Source: {$srcpkg}
+Priority: standard
+Section: devel
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 7.0.50~)
+
+Package: {$srcpkg}
+Architecture: all
+Depends: $\{misc:Depends\},
+ some-replacement
+Description: {$description}
+ This is a transitional package that should have been in section
+ oldlibs and priority extra.
diff --git a/t/tests/fields-depends-general/debian/debian/install b/t/tests/fields-transitional/debian/debian/install
similarity index 100%
copy from t/tests/fields-depends-general/debian/debian/install
copy to t/tests/fields-transitional/debian/debian/install
diff --git a/t/tests/fields-depends-general/debian/some-file b/t/tests/fields-transitional/debian/some-file
similarity index 100%
copy from t/tests/fields-depends-general/debian/some-file
copy to t/tests/fields-transitional/debian/some-file
diff --git a/t/tests/fields-transitional/desc b/t/tests/fields-transitional/desc
new file mode 100644
index 0000000..8bddca9
--- /dev/null
+++ b/t/tests/fields-transitional/desc
@@ -0,0 +1,5 @@
+Testname: fields-transitional
+Sequence: 6000
+Version: 1.0
+Description: Test for transitional package in wrong section
+Test-For: transitional-package-should-be-oldlibs-extra
diff --git a/t/tests/fields-transitional/tags b/t/tests/fields-transitional/tags
new file mode 100644
index 0000000..aa0fcb5
--- /dev/null
+++ b/t/tests/fields-transitional/tags
@@ -0,0 +1 @@
+W: fields-transitional: transitional-package-should-be-oldlibs-extra devel/standard
--
Debian package checker
Reply to: