[SCM] Debian package checker branch, master, updated. 2.2.13-58-g72ef805
The following commit has been merged in the master branch:
commit 66f097c92d232525429d744cd206c2dcdaa3eea1
Author: Russ Allbery <rra@debian.org>
Date: Sat Aug 15 21:21:13 2009 -0700
Make generic the test for dependencies on metapackages
* checks/fields{,.desc}:
+ [RA] Renamed the tags for depending or build-depending on X
metapackages to make them generic and load the list of metapackages
from data/fields/metapackages. Always consider known metapackages
to be metapackages for the dependency check.
* data/fields/metapackages:
+ [RA] New file listing known metapackages that should not be used in
Depends or Build-Depends.
diff --git a/checks/fields b/checks/fields
index da202a8..44caa07 100644
--- a/checks/fields
+++ b/checks/fields
@@ -35,7 +35,8 @@ use Lintian::Check qw(check_maintainer);
use Lintian::Relation ();
use Lintian::Relation::Version qw(versions_compare);
-our $KNOWN_ARCHS = Lintian::Data->new ('fields/architectures');
+our $KNOWN_ARCHS = Lintian::Data->new('fields/architectures');
+our $KNOWN_METAPACKAGES = Lintian::Data->new('fields/metapackages');
our %known_archive_parts = map { $_ => 1 }
('non-free', 'contrib');
@@ -101,10 +102,6 @@ our %known_tkxs = map { $_ => 1 }
our %known_libpngs = map { $_ => 1 }
( 'libpng12-0', 'libpng2', 'libpng3', );
-our %known_x_metapackages = map { $_ => 1 }
- ( 'x-window-system', 'x-window-system-dev', 'x-window-system-core',
- 'xorg', 'xorg-dev', );
-
# Mapping of package names to section names
my @NAME_SECTION_MAPPINGS = (
[ qr/-docs?$/ => 'doc' ],
@@ -467,13 +464,18 @@ if (defined $info->field('installer-menu-item')) {
my $metapackage = 0;
if ($type eq 'binary' && $arch_indep) {
$metapackage = 1;
- foreach my $file (keys %{$info->index}) {
+ for my $file (keys %{$info->index}) {
next if $info->index->{$file}->{type} =~ /^d/;
next if $file =~ m%^usr/share/doc/%;
next if $file =~ m%^usr/share/lintian/overrides/%;
next if $file =~ m%^usr/share/cdd/%;
$metapackage = 0;
+ last;
}
+
+ # Packages we say are metapackages are always metapackages even if
+ # they don't look like it.
+ $metapackage = 1 if $KNOWN_METAPACKAGES->known($pkg);
}
if (($type eq "binary") || ($type eq 'udeb')) {
my (%deps, %fields, %parsed);
@@ -543,8 +545,8 @@ if (($type eq "binary") || ($type eq 'udeb')) {
push @seen_obsolete_packages, $part_d_orig
if ($OBSOLETE_PACKAGES->known($d_pkg) && &$is_dep_field($field));
- tag "depends-on-x-metapackage", "$field: $part_d_orig"
- if ($known_x_metapackages{$d_pkg} && ! $metapackage && &$is_dep_field($field));
+ tag "depends-on-metapackage", "$field: $part_d_orig"
+ if ($KNOWN_METAPACKAGES->known($d_pkg) and not $metapackage and &$is_dep_field($field));
tag "depends-on-essential-package-without-using-version", "$field: $part_d_orig"
if ($known_essential{$d_pkg} && ! $d_version->[0] && &$is_dep_field($field));
@@ -677,8 +679,8 @@ if ($type eq "source") {
push @seen_obsolete_packages, $part_d_orig
if ($OBSOLETE_PACKAGES->known($d_pkg) && &$is_dep_field($field));
- tag "build-depends-on-x-metapackage", "$field: $part_d_orig"
- if ($known_x_metapackages{$d_pkg} && &$is_dep_field($field));
+ tag "build-depends-on-metapackage", "$field: $part_d_orig"
+ if ($KNOWN_METAPACKAGES->known($d_pkg) and &$is_dep_field($field));
tag "build-depends-on-1-revision", "$field: $part_d_orig"
if ($d_version->[0] eq '>=' && $d_version->[1] =~ /-1$/ && &$is_dep_field($field));
diff --git a/checks/fields.desc b/checks/fields.desc
index a866ff6..c67b19f 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -502,18 +502,17 @@ Info: The package lists an old version of Emacs as its first dependency.
for example, it was included with later versions of Emacs), add a lintian
override.
-Tag: depends-on-x-metapackage
+Tag: depends-on-metapackage
Severity: important
-Certainty: certain
-Info: Packages that are not themselves metapackages must not depend on X
- Window System metapackages.
- .
- The metapackages xorg, xorg-dev, x-window-system, x-window-system-dev, and
- x-window-system-core exist only for the benefit of users and dependencies
- for other metapackages and should not be used in regular package
- dependencies.
-
-Tag: build-depends-on-x-metapackage
+Certainty: possible
+Info: This package is one of the packages that Lintian believes is a
+ metapackage: a package that exists for the convenience of users or
+ installers to install a set of related packages. Packages that are not
+ themselves metapackages must not depend on metapackages, since this may
+ prevent the user from removing portions of the package set they don't
+ need.
+
+Tag: build-depends-on-metapackage
Severity: important
Certainty: certain
Info: Packages must not build-depend on X Window System metapackages.
diff --git a/data/fields/metapackages b/data/fields/metapackages
new file mode 100644
index 0000000..890e388
--- /dev/null
+++ b/data/fields/metapackages
@@ -0,0 +1,10 @@
+# Known metapackages. A metapackage is a package that exists for the
+# convenience of users or installers to install a set of related packages
+# and should not be used as a dependency of anything other than another
+# metapackage. It should not be used as a build dependency ever.
+
+x-window-system
+x-window-system-dev
+x-window-system-core
+xorg
+xorg-dev
diff --git a/debian/changelog b/debian/changelog
index 94c3231..b1d14c6 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,9 @@ lintian (2.2.14) UNRELEASED; urgency=low
- possible-documentation-but-no-doc-base-registration
+ Removed:
- file-in-usr-something-x11-without-pre-depends
+ + Renamed:
+ - depends-on-x-metapackage => depends-on-metapackage
+ - build-depends-on-x-metapackage => build-depends-on-metapackage
* checks/changelog-file.desc:
+ [RA] Document the "Old Changelog" way of marking historic changelog
@@ -29,7 +32,7 @@ lintian (2.2.14) UNRELEASED; urgency=low
* checks/description:
+ [RA] Decode descriptions from UTF-8 before checking length. Thanks,
Charles Plessy. (Closes: #537207)
- * checks/fields{,.desc}
+ * checks/fields{,.desc}:
+ [FL] packages named lib*-camlp4-dev should be in section ocaml
+ [RA] Move debian/rules parsing to check build dependencies to
checks/rules.
@@ -42,6 +45,10 @@ lintian (2.2.14) UNRELEASED; urgency=low
turn ensures that they keep getting that tag.
+ [RA] Recognize packages as metapackages even if they contain files
in /usr/share/cdd.
+ + [RA] Renamed the tags for depending or build-depending on X
+ metapackages to make them generic and load the list of metapackages
+ from data/fields/metapackages. Always consider known metapackages
+ to be metapackages for the dependency check.
* checks/files{,.desc}:
+ [CW] /var/lock and /var/run are not temporary filesystems in d-i, so
don't emit errors about their use in udebs.
@@ -97,6 +104,9 @@ lintian (2.2.14) UNRELEASED; urgency=low
* data/fields/architectures:
+ [RA] Refresh architecture list against dpkg 1.15.3.1, adding avr32
and kopensolaris. (Closes: #538055)
+ * data/fields/metapackages:
+ + [RA] New file listing known metapackages that should not be used in
+ Depends or Build-Depends.
* data/fields/virtual-packages:
+ [ADB] Refresh against unstable.
* data/files/fonts:
diff --git a/t/templates/pedantic/debian/control.in b/t/tests/fields-depends-general/debian/debian/control.in
similarity index 79%
copy from t/templates/pedantic/debian/control.in
copy to t/tests/fields-depends-general/debian/debian/control.in
index 86fc105..e63ee3b 100644
--- a/t/templates/pedantic/debian/control.in
+++ b/t/tests/fields-depends-general/debian/debian/control.in
@@ -3,12 +3,11 @@ Priority: extra
Section: {$section}
Maintainer: {$author}
Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7.0.50~)
-Homepage: http://lintian.debian.org/
+Build-Depends: debhelper (>= 7.0.50~), xorg-dev
Package: {$srcpkg}
Architecture: {$architecture}
-Depends: $\{misc:Depends\}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, xorg
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/fields-depends-general/debian/debian/install b/t/tests/fields-depends-general/debian/debian/install
new file mode 100644
index 0000000..6c37889
--- /dev/null
+++ b/t/tests/fields-depends-general/debian/debian/install
@@ -0,0 +1 @@
+some-file usr/share/lintian
diff --git a/t/tests/fields-depends-general/debian/some-file b/t/tests/fields-depends-general/debian/some-file
new file mode 100644
index 0000000..7bf08f7
--- /dev/null
+++ b/t/tests/fields-depends-general/debian/some-file
@@ -0,0 +1,2 @@
+This file is installed into /usr/share/lintian just to ensure that this
+package doesn't look like a metapackage for the dependency checks.
diff --git a/t/tests/fields-depends-general/desc b/t/tests/fields-depends-general/desc
new file mode 100644
index 0000000..8696843
--- /dev/null
+++ b/t/tests/fields-depends-general/desc
@@ -0,0 +1,7 @@
+Testname: fields-depends-general
+Sequence: 6000
+Version: 1.0
+Description: General tests for package dependencies
+Test-For:
+ build-depends-on-metapackage
+ depends-on-metapackage
diff --git a/t/tests/fields-depends-general/tags b/t/tests/fields-depends-general/tags
new file mode 100644
index 0000000..bef84a4
--- /dev/null
+++ b/t/tests/fields-depends-general/tags
@@ -0,0 +1,2 @@
+E: fields-depends-general source: build-depends-on-metapackage build-depends: xorg-dev
+E: fields-depends-general: depends-on-metapackage depends: xorg
diff --git a/t/templates/pedantic/debian/control.in b/t/tests/fields-depends-metapackage/debian/debian/control.in
similarity index 79%
copy from t/templates/pedantic/debian/control.in
copy to t/tests/fields-depends-metapackage/debian/debian/control.in
index 86fc105..e63ee3b 100644
--- a/t/templates/pedantic/debian/control.in
+++ b/t/tests/fields-depends-metapackage/debian/debian/control.in
@@ -3,12 +3,11 @@ Priority: extra
Section: {$section}
Maintainer: {$author}
Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7.0.50~)
-Homepage: http://lintian.debian.org/
+Build-Depends: debhelper (>= 7.0.50~), xorg-dev
Package: {$srcpkg}
Architecture: {$architecture}
-Depends: $\{misc:Depends\}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, xorg
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/fields-depends-metapackage/desc b/t/tests/fields-depends-metapackage/desc
new file mode 100644
index 0000000..eb102e7
--- /dev/null
+++ b/t/tests/fields-depends-metapackage/desc
@@ -0,0 +1,6 @@
+Testname: fields-depends-metapackage
+Sequence: 6000
+Version: 1.0
+Description: Tests for package dependencies in a metapackage
+Test-For: build-depends-on-metapackage
+Test-Against: depends-on-metapackage
diff --git a/t/tests/fields-depends-metapackage/tags b/t/tests/fields-depends-metapackage/tags
new file mode 100644
index 0000000..fde8b0a
--- /dev/null
+++ b/t/tests/fields-depends-metapackage/tags
@@ -0,0 +1 @@
+E: fields-depends-metapackage source: build-depends-on-metapackage build-depends: xorg-dev
diff --git a/testset/tags.binary b/testset/tags.binary
index 7be45d7..8316c5d 100644
--- a/testset/tags.binary
+++ b/testset/tags.binary
@@ -4,7 +4,7 @@ E: binary source: not-binnmuable-any-depends-all binary -> binary-data
E: binary: changelog-file-not-compressed changelog
E: binary: debian-changelog-file-missing-or-wrong-name
E: binary: debian-news-file-uses-obsolete-national-encoding at line 3
-E: binary: depends-on-x-metapackage pre-depends: xorg
+E: binary: depends-on-metapackage pre-depends: xorg
E: binary: deprecated-kdelnk-file /usr/share/applications/hello.kdelnk
E: binary: desktop-entry-missing-required-key /usr/share/applications/goodbye.desktop Name
E: binary: doc-base-document-field-ends-in-whitespace binary:1
--
Debian package checker
Reply to: