lintian: r601 - in trunk: checks debian testset testset/binary/debian testset/relations/debian
Author: rra
Date: 2006-04-03 04:00:43 +0200 (Mon, 03 Apr 2006)
New Revision: 601
Modified:
trunk/checks/fields
trunk/checks/fields.desc
trunk/debian/changelog
trunk/testset/binary/debian/control
trunk/testset/relations/debian/control
trunk/testset/tags.binary
Log:
Add a check for dependencies on X metapackages to finish closing #347169.
Only packages that are arch: all and have no files outside of
/usr/share/doc are allowed to depend on the X metapackages. There's
still a risk of false negatives with documentation packages, but that's
not much of a worry.
Modified: trunk/checks/fields
===================================================================
--- trunk/checks/fields 2006-04-03 00:41:07 UTC (rev 600)
+++ trunk/checks/fields 2006-04-03 02:00:43 UTC (rev 601)
@@ -58,6 +58,7 @@
my $pkg = shift;
my $type = shift;
my $version;
+my $arch_indep;
local $/ = undef; #Read everything in one go
@@ -140,6 +141,9 @@
tag "too-many-architectures", "" if (@archs > 1);
tag "arch-any-in-binary-pkg", "" if (grep { $_ eq "any" } @archs);
}
+
+ # Used for later tests.
+ $arch_indep = 1 if (@archs == 1 && $archs[0] eq 'all');
}
#---- Subarchitecture (udeb)
@@ -279,6 +283,22 @@
#---- Package relations (binary package)
+# Check whether the package looks like a meta-package, used for later
+# dependency checks. We consider a package to possibly be a meta-package if
+# it is a binary package, arch: all, with no files outside of /usr/share/doc.
+my $metapackage = 0;
+if ($type eq 'binary' && $arch_indep) {
+ $metapackage = 1;
+ open IN, "index" or fail("cannot open index file index: $!");
+ local $_;
+ local $/ = "\n";
+ while (<IN>) {
+ my ($mode, $file) = (split(' ', $_, 6))[0,5];
+ next unless $file;
+ $metapackage = 0 unless ($mode =~ /^d/ || $file =~ m%^\./usr/share/doc/%);
+ }
+ close IN;
+}
if (($type eq "binary") || ($type eq 'udeb')) {
my %deps;
for my $field (qw(depends pre-depends recommends suggests conflicts provides replaces)) {
@@ -337,6 +357,9 @@
tag "depends-on-obsolete-package", "$field: $part_d_orig"
if ($known_obsolete_packages{$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-essential-package-without-using-version", "$field: $part_d_orig"
if ($d_pkg ne "coreutils" && $known_essential{$d_pkg} && ! $d_version->[0] && &$is_dep_field($field));
Modified: trunk/checks/fields.desc
===================================================================
--- trunk/checks/fields.desc 2006-04-03 00:41:07 UTC (rev 600)
+++ trunk/checks/fields.desc 2006-04-03 02:00:43 UTC (rev 601)
@@ -354,6 +354,16 @@
Type: error
Info: The package build-depends on a package that has been superseded.
+Tag: depends-on-x-metapackage
+Type: error
+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
Type: error
Info: Packages must not build-depend on X Window System metapackages.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2006-04-03 00:41:07 UTC (rev 600)
+++ trunk/debian/changelog 2006-04-03 02:00:43 UTC (rev 601)
@@ -15,8 +15,10 @@
it is invoked in clean, build-arch, or binary-arch.
+ [RA] Only list examples of non-standard architectures, since there
are now too many combinations to list completely.
- + [RA] Catch build dependencies on X metapackages, based on a patch by
- Josh Triplett. (Partially addresses #347169)
+ + [RA] Catch dependencies on X metapackages, based on a patch by Josh
+ Triplett. No packages are allowed to build-depend, and only
+ packages that look like metapackages (arch: all, no files outside of
+ /usr/share/doc) are allowed to depend. (Closes: #347169)
* checks/manpages:
+ [RA] Use system_env instead of system and sanitize the environment
before running man -l out of caution and to avoid extraneous output
Modified: trunk/testset/binary/debian/control
===================================================================
--- trunk/testset/binary/debian/control 2006-04-03 00:41:07 UTC (rev 600)
+++ trunk/testset/binary/debian/control 2006-04-03 02:00:43 UTC (rev 601)
@@ -7,6 +7,6 @@
Package: binary
Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, xorg
Description: test handling of binary files
Regression test for lintian's handling of binary files.
Modified: trunk/testset/relations/debian/control
===================================================================
--- trunk/testset/relations/debian/control 2006-04-03 00:41:07 UTC (rev 600)
+++ trunk/testset/relations/debian/control 2006-04-03 02:00:43 UTC (rev 601)
@@ -27,7 +27,7 @@
Package: relations-multiple-libs
Architecture: all
-Depends: libstdc++2.10, libstdc++2.10-glibc2.2, libstdc++3.0, tk8.2, tk8.3, tcl8.0, tcl8.2, tkx8.2, tkx8.3, tclx8.2, libpng2, libpng3
+Depends: libstdc++2.10, libstdc++2.10-glibc2.2, libstdc++3.0, tk8.2, tk8.3, tcl8.0, tcl8.2, tkx8.2, tkx8.3, tclx8.2, libpng2, libpng3, xorg
Provides: awk
Provides: awk
Description: Duplicate library dependency relationships.
@@ -36,3 +36,6 @@
at the same time.
.
At the same time, it conveniently tests some description file checks. :)
+ .
+ It is a metapackage from the lintian perspective, so the xorg dependency
+ should be allowed.
Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary 2006-04-03 00:41:07 UTC (rev 600)
+++ trunk/testset/tags.binary 2006-04-03 02:00:43 UTC (rev 601)
@@ -1,5 +1,6 @@
E: binary: changelog-file-not-compressed changelog
E: binary: debian-changelog-file-missing-or-wrong-name
+E: binary: depends-on-x-metapackage depends: xorg
E: binary: file-directly-in-usr-share usr/share/baz
E: binary: menu-item-missing-required-tag section /usr/lib/menu/binary:1
E: binary: menu-item-missing-required-tag section /usr/share/menu/binary:1
Reply to: