[SCM] Debian package checker branch, master, updated. 2.5.10-239-g1975a4c
The following commit has been merged in the master branch:
commit 1975a4c6f7911784333bc457409e7ea184f815fa
Author: Niels Thykier <niels@thykier.net>
Date: Wed Nov 7 10:04:40 2012 +0100
L::C::Binary: Replace is_transition with is_pkg_class
Replace is_transition with the more general is_pkg_class, which can
also determine if a package is a "meta package".
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/checks/changelog-file b/checks/changelog-file
index 8bcab22..b03ef23 100644
--- a/checks/changelog-file
+++ b/checks/changelog-file
@@ -193,7 +193,7 @@ if ($native_pkg) {
}
}
if (not $found) {
- tag 'no-upstream-changelog' unless $info->is_transitional;
+ tag 'no-upstream-changelog' unless $info->is_pkg_class ('transitional');
}
}
diff --git a/checks/fields b/checks/fields
index 476a21d..c32b207 100644
--- a/checks/fields
+++ b/checks/fields
@@ -489,7 +489,7 @@ if (not defined $info->field('section')) {
last;
}
}
- if ($info->is_transitional) {
+ if ($info->is_pkg_class ('transitional')) {
my $pri = $info->field ('priority', '');
# Cannot use "unfold" as it could emit a tag for priority,
# which will be duplicated below.
diff --git a/checks/files b/checks/files
index f9671c7..7d9ece5 100644
--- a/checks/files
+++ b/checks/files
@@ -146,12 +146,6 @@ my @flash_nonfree = (
# qr,(?i)xspf_jukebox\.swf$,
);
-# Regexes to try against the package description to find metapackages or
-# transitional packages.
-my @METAPKG_REGEX =
- (qr/meta[ -]?package/, qr/dummy/,
- qr/(?:dependency|empty|virtual) package/);
-
# Common files stored in /usr/share/doc/$pkg that aren't sufficient to
# consider the package non-empty.
my $STANDARD_FILES = Lintian::Data->new('files/standard-files');
@@ -214,16 +208,8 @@ my @devhelp_links;
my %x11_font_dirs;
# Check if package is empty
-my $is_dummy = $info->is_transitional;
-my $description = $info->field('description');
-if (!$is_dummy && $description) {
- for my $regex (@METAPKG_REGEX) {
- if ($description =~ /$regex/) {
- $is_dummy = 1;
- last;
- }
- }
-}
+my $is_dummy = $info->is_pkg_class ('any-meta');
+
if (!$is_dummy) {
my $is_empty = 1;
for my $file ($info->sorted_index) {
diff --git a/debian/changelog b/debian/changelog
index dcd18cd..4f33344 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -75,6 +75,8 @@ lintian (2.5.11) UNRELEASED; urgency=low
Vcs-* fields. (Closes: #681769)
* checks/files:
+ [RG] Recognise smarty3 as smarty itself.
+ + [NT] Consider "tasksel tasks" as a meta package.
+ (Closes: #691489)
* checks/group-checks{,.desc}:
+ [NT] Detect debug packages not co-installable with itself,
when it provides debug symbols for a Multi-Arch: same package.
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index 6331d83..e89d11b 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -556,20 +556,55 @@ sub relation {
return $self->{relation}->{$field};
}
-=item is_transitional
+=item is_pkg_class ([TYPE])
-Returns a truth value if the package appears to be a transitional
-package.
+Returns a truth value if the package is the given TYPE of special
+package. TYPE can be one of "transitional" or "any-meta". If omitted
+it defaults to "any-meta". The semantics for these values are:
-This is based on the package's description.
+=over 4
+
+=item transitional
+
+The package is (probably) a transitional package (e.g. it is probably
+empty, just depend on stuff will eventually disappear.)
+
+Guessed from package description.
+
+=item any-meta
+
+This package is (probably) some kind of meta or task package. A meta
+package is usually empty and just depend on stuff. It will also
+return a truth value for "tasks" (i.e. tasksel "tasks").
+
+A transitional package will also match this.
+
+Guessed from package description, section or package name.
+
+=back
=cut
-# sub is_transitional Needs-Info :field
-sub is_transitional {
- my ($self) = @_;
- my $desc = $self->field ('description')//'';
- return $desc =~ m/transitional package/;
+# sub is_pkg_class Needs-Info :field
+
+{
+ # Regexes to try against the package description to find metapackages or
+ # transitional packages.
+ my $METAPKG_REGEX = qr/meta[ -]?package|dummy|(?:dependency|empty|virtual) package/;
+
+ sub is_pkg_class {
+ my ($self, $pkg_class) = @_;
+ my $desc = $self->field ('description', '');
+ $pkg_class //= 'any-meta';
+ return 1 if $desc =~ m/transitional package/;
+ if ($pkg_class eq 'any-meta') {
+ my ($section) = $self->field ('section', '');
+ return 1 if $desc =~ m/$METAPKG_REGEX/o;
+ return 1 if $section =~ m,(?:^|/)tasks$,;
+ return 1 if $self->name =~ m/^task-/;
+ }
+ return;
+ }
}
=item is_conffile (FILE)
--
Debian package checker
Reply to: