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

[SCM] Debian package checker branch, master, updated. 2.1.6-33-gf39df20



The following commit has been merged in the master branch:
commit f39df2078c58201ce8d900ef7352954a11b9596a
Author: Russ Allbery <rra@debian.org>
Date:   Sat Jan 24 15:17:04 2009 -0800

    Improve package-depends-on-{itself,hardcoded-libc}
    
    * checks/control-file{,.desc}:
      + [RA] Check for hard-coded package dependencies on libc.  Patch from
        Evgeni Golov.  (Closes: #512196)
      + [RA] Check package-depends-on-itself for Suggests as well.

diff --git a/checks/control-file b/checks/control-file
index 6f12699..03500c0 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -103,14 +103,19 @@ for my $binary_control (@binary_controls) {
 #
 # Also check if a package declares a simple dependency on itself, since
 # similarly dpkg-gencontrol will clean this up for us but it may be a sign of
-# another problem.
+# another problem, and check that the package doesn't hard-code a dependency
+# on libc.  We have to do the latter check here rather than in checks/fields
+# to distinguish from dependencies created by ${shlibs:Depends}.
 my @dep_fields = qw(pre-depends depends recommends suggests);
+my $libcs = Dep::parse(join(' | ', qw(libc6 libc6.1 libc0.1 libc0.3)));
 for my $control (@binary_controls) {
-	for my $strong (0 .. ($#dep_fields - 1)) {
+	for my $strong (0 .. $#dep_fields) {
 		next unless $control->{$dep_fields[$strong]};
 		my $parsed = Dep::parse ($control->{$dep_fields[$strong]});
 		tag "package-depends-on-itself", $control->{package}, $dep_fields[$strong]
 		    if Dep::implies($parsed, Dep::parse($control->{package}));
+		tag 'package-depends-on-hardcoded-libc', $control->{package}, $dep_fields[$strong]
+		    if (Dep::implies($parsed, $libcs) and $control->{package} ne "glibc");
 		for my $weak (($strong + 1) .. $#dep_fields) {
 			next unless $control->{$dep_fields[$weak]};
 			for my $dependency (split /\s*,\s*/, $control->{$dep_fields[$weak]}) {
@@ -122,21 +127,6 @@ for my $control (@binary_controls) {
 	}
 }
 
-# Check that packages do not hardcode a depend on any variant of libc
-@dep_fields = qw(pre-depends depends);
-my @libcs = qw(libc6 libc6.1 libc0.1 libc0.3);
-for my $control (@binary_controls) {
-	for my $field (0 .. ($#dep_fields)) {
-		next unless $control->{$dep_fields[$field]};
-		my $parsed = Dep::parse ($control->{$dep_fields[$field]});
-		for my $libc (@libcs) {
-			tag "package-depends-on-hardcoded-libc", $control->{package}, $dep_fields[$field], $libc
-				if Dep::implies($parsed, Dep::parse($libc)) and $control->{package} ne "glibc";
-		}
-		
-	}
-}
-
 # Check that every package is in the same archive category, except that
 # sources in main can deliver both main and contrib packages.  The source
 # package may or may not have a section specified; if it doesn't, derive the
diff --git a/checks/control-file.desc b/checks/control-file.desc
index 4dd79ad..2254752 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -138,4 +138,3 @@ Severity: normal
 Certainty: certain
 Info: The given package declares a dependency on libc directly instead
  of using ${shlibs:Depends} in its <tt>debian/control</tt> stanza.
-
diff --git a/debian/changelog b/debian/changelog
index b2ea9b9..5b96cab 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,8 +17,11 @@ lintian (2.2.0) UNRELEASED; urgency=low
     + [RA] Enable no-upstream-changelog as a pedantic check, since it's
       often incorrect for multiple binary packages generated from the same
       source.  Patch from Raphael Geissert.  (Closes: #470912)
-  * checks/control-file.desc:
+  * checks/control-file{,.desc}:
     + [ADB] Fix a typo ("arne't").  Thanks, Raphael Geissert.
+    + [RA] Check for hard-coded package dependencies on libc.  Patch from
+      Evgeni Golov.  (Closes: #512196)
+    + [RA] Check package-depends-on-itself for Suggests as well.
   * checks/debhelper.desc:
     + [ADB] Remove no longer required "Type" fields from a couple of
       entries.  Thanks, Raphael Geissert.
diff --git a/t/COVERAGE b/t/COVERAGE
index ff6cb4b..8e66d8a 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -79,7 +79,6 @@ fields malformed-python-version
 fields missing-build-dependency
 fields multiline-field
 fields no-architecture-field
-fields no-homepage-field
 fields no-maintainer-field
 fields no-package-name
 fields no-source-field
@@ -210,7 +209,6 @@ menus prerm-has-useless-call-to-install-docs
 
 nmu changelog-is-symlink
 
-patch-systems direct-changes-in-diff-but-no-patch-system
 patch-systems more-than-one-patch-system
 patch-systems patch-modifying-debian-files
 patch-systems quilt-patch-with-non-standard-options
diff --git a/t/tests/debhelper-dh-clean-k-deprecated/debian/debian/control.in b/t/tests/control-file-hardcoded-libc/debian/debian/control.in
similarity index 78%
copy from t/tests/debhelper-dh-clean-k-deprecated/debian/debian/control.in
copy to t/tests/control-file-hardcoded-libc/debian/debian/control.in
index ff1a285..a4faec1 100644
--- a/t/tests/debhelper-dh-clean-k-deprecated/debian/debian/control.in
+++ b/t/tests/control-file-hardcoded-libc/debian/debian/control.in
@@ -7,7 +7,10 @@ Build-Depends: debhelper (>= 7)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
-Depends: $\{misc:Depends\}
+Pre-Depends: libc0.1
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, libc6
+Recommends: libc6.1
+Suggests: libc0.3
 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/control-file-hardcoded-libc/desc b/t/tests/control-file-hardcoded-libc/desc
new file mode 100644
index 0000000..639d636
--- /dev/null
+++ b/t/tests/control-file-hardcoded-libc/desc
@@ -0,0 +1,5 @@
+Testname: control-file-hardcoded-libc
+Sequence: 6000
+Version: 1.0
+Test-For: package-depends-on-hardcoded-libc
+References: Debian Bug#512196
diff --git a/t/tests/control-file-hardcoded-libc/tags b/t/tests/control-file-hardcoded-libc/tags
new file mode 100644
index 0000000..8c6c264
--- /dev/null
+++ b/t/tests/control-file-hardcoded-libc/tags
@@ -0,0 +1,4 @@
+W: control-file-hardcoded-libc source: package-depends-on-hardcoded-libc control-file-hardcoded-libc depends
+W: control-file-hardcoded-libc source: package-depends-on-hardcoded-libc control-file-hardcoded-libc pre-depends
+W: control-file-hardcoded-libc source: package-depends-on-hardcoded-libc control-file-hardcoded-libc recommends
+W: control-file-hardcoded-libc source: package-depends-on-hardcoded-libc control-file-hardcoded-libc suggests
diff --git a/t/templates/skel/debian/control.in b/t/tests/control-file-suggests-itself/debian/debian/control.in
similarity index 95%
copy from t/templates/skel/debian/control.in
copy to t/tests/control-file-suggests-itself/debian/debian/control.in
index f8f5c04..6247cd4 100644
--- a/t/templates/skel/debian/control.in
+++ b/t/tests/control-file-suggests-itself/debian/debian/control.in
@@ -8,6 +8,7 @@ Build-Depends: debhelper (>= 7)
 Package: {$srcpkg}
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Suggests: {$srcpkg}
 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/control-file-suggests-itself/desc b/t/tests/control-file-suggests-itself/desc
new file mode 100644
index 0000000..1be7092
--- /dev/null
+++ b/t/tests/control-file-suggests-itself/desc
@@ -0,0 +1,4 @@
+Testname: control-file-suggests-itself
+Sequence: 6000
+Version: 1.0
+Test-For: package-depends-on-itself
diff --git a/t/tests/control-file-suggests-itself/tags b/t/tests/control-file-suggests-itself/tags
new file mode 100644
index 0000000..62f4fbd
--- /dev/null
+++ b/t/tests/control-file-suggests-itself/tags
@@ -0,0 +1 @@
+W: control-file-suggests-itself source: package-depends-on-itself control-file-suggests-itself suggests

-- 
Debian package checker


Reply to: