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

[SCM] Debian package checker branch, master, updated. 2.2.18-66-g22786ed



The following commit has been merged in the master branch:
commit 22786eda87603bf2442fc9f1666f8bfa8bde1f57
Author: Russ Allbery <rra@debian.org>
Date:   Fri Dec 25 11:37:59 2009 -0800

    Various fixes to python-dev without arch: any tag
    
    Rename the tag to start with build-depends-on like other similar tags.
    Move the check from control-file to fields, where it can take advantage
    of more existing infrastructure.  Add a test suite and a changelog
    entry.

diff --git a/checks/control-file b/checks/control-file
index aeacccb..fc448d7 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -276,21 +276,6 @@ for my $i (0 .. $#descriptions) {
 	}
 }
 
-# Check for python*-dev build-dependency with Architecture: any packages
-my $isNotAll = 0;
-my $pydev_bd;
-my $pydev_bdi;
-$pydev_bd = $header->{"build-depends"} =~ /python(-all|[\d.])*-dev/ if $header->{"build-depends"};
-$pydev_bdi = $header->{"build-depends-indep"} =~ /python(-all|[\d.])*-dev/ if $header->{"build-depends-indep"};
-if ($pydev_bd or $pydev_bdi) {
-	for my $control (@binary_controls) {
-		foreach ($control->{architecture}) {
-			$isNotAll = 1 if ($_ ne 'all');
-		}
-	}
-	tag 'python-dev-with-no-arch-any-packages' if ($isNotAll eq 0);
-}
-
 }
 
 1;
diff --git a/checks/control-file.desc b/checks/control-file.desc
index d6c9989..366ba71 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -169,17 +169,3 @@ Info: The given package appears to be a shared library -dev package, but
  dependency since it would break binary NMUs.  Instead, a dependency of
  <tt>(>= ${source:Upstream-Version}), (<< ${source:Version}.1~)</tt> or
  similar is usually the correct approach.
-
-Tag: python-dev-with-no-arch-any-packages
-Severity: normal
-Certainty: possible
-Info: The given package appears to have a Python development package
- (python-dev, python-all-dev or pythonX.Y-dev) listed in its Build-Depends
- or Build-Depends-Indep fields, but only "Architecture: all" packages are
- created. Python applications and modules do not usually require such
- packages, so you should consider removing them in favour of python,
- python-all or pythonX.Y packages.
- .
- If you are building a Python extension instead, you should have
- development packages listed in Build-Depends, but you need at least one
- "Architecture: any" package.
diff --git a/checks/fields b/checks/fields
index cfed329..6a3f6e9 100644
--- a/checks/fields
+++ b/checks/fields
@@ -145,6 +145,12 @@ my %VCS_VALID_URIS = (
     svn     => qr;^(?:svn\+)?ssh://;,
 );
 
+# Python development packages that are used almost always just for building
+# architecture-dependent modules.  Used to check for unnecessary build
+# dependencies for architecture-independent source packages.
+our $PYTHON_DEV = join(' | ', qw(python-dev python-all-dev python3-all-dev),
+		       map { "python$_-dev" } qw(2.4 2.5 2.6 3 3.1));
+
 our $PERL_CORE_PROVIDES = Lintian::Data->new('fields/perl-provides', '\s+');
 our $OBSOLETE_PACKAGES  = Lintian::Data->new('fields/obsolete-packages');
 our $VIRTUAL_PACKAGES   = Lintian::Data->new('fields/virtual-packages');
@@ -762,7 +768,13 @@ if ($type eq "source") {
 		$deps  = $info->binary_field($_, 'pre-depends') . ', ';
 		$deps .= $info->binary_field($_, 'depends');
 		tag 'dbg-package-missing-depends', $_
-		   unless (grep {my $quoted_name = qr<\Q$_>; $deps =~ m/(\s|,|^)$quoted_name(\s|,|$)/} @arch_dep_pkgs);
+		   unless (grep {my $quoted_name = qr<\Q$_>; $deps =~ m/(\s|,|^)$quoted_name(\s|,|\z)/} @arch_dep_pkgs);
+	}
+
+	# Check for a python*-dev build dependency in source packages that
+	# build only arch: all packages.
+	if ($arch_dep_packages == 0 and $build_all->implies($PYTHON_DEV)) {
+		tag 'build-depends-on-python-dev-with-no-arch-any';
 	}
 }
 
diff --git a/checks/fields.desc b/checks/fields.desc
index 660a81c..8288f1b 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -948,3 +948,17 @@ Info: The given package appears to be a library package, but it recommends
  recommend the documentation instead.  If there is no development package
  (for modules for scripting languages, for example), consider Suggests
  instead of Recommends.
+
+Tag: build-depends-on-python-dev-with-no-arch-any
+Severity: normal
+Certainty: possible
+Info: The given package appears to have a Python development package
+ (python-dev, python-all-dev or pythonX.Y-dev) listed in its Build-Depends
+ or Build-Depends-Indep fields, but only "Architecture: all" packages are
+ built by this source package.  Python applications and modules do not
+ usually require those dev packages, so you should consider removing them
+ in favour of python, python-all or pythonX.Y.
+ .
+ If you are building a Python extension instead, you should have
+ development packages listed in Build-Depends, but normally there should
+ be at least one Architecture: any package.
diff --git a/debian/changelog b/debian/changelog
index e7f324d..fcbec02 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,9 @@ lintian (2.3.0) UNRELEASED; urgency=low
       (Closes: #557786)
     + [RA] For lib-recommends-documentation, exclude packages ending in
       -tools or -bin.  Thanks, Jay Berkenbilt.  (Closes: #557883)
+    + [RA] Warn of build dependencies on python*-dev if no architecture-
+      dependent packages are being built.  Patch from Luca Falavigna.
+      (Closes: #551793)
   * checks/files{,.desc}:
     + [RA] New check for files present in both compressed and uncompressed
       form.  Patch from Raphael Geissert.  (Closes: #546174)
diff --git a/t/tests/fields-depends-general/debian/debian/control.in b/t/tests/fields-depends-general/debian/debian/control.in
index d213c6d..8abffe9 100644
--- a/t/tests/fields-depends-general/debian/debian/control.in
+++ b/t/tests/fields-depends-general/debian/debian/control.in
@@ -3,7 +3,8 @@ Priority: extra
 Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7.0.50~), xorg-dev, java-propose-classpath
+Build-Depends: debhelper (>= 7.0.50~), xorg-dev, java-propose-classpath,
+ python3.1-dev
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/fields-depends-general/desc b/t/tests/fields-depends-general/desc
index e6d1863..f8b72ff 100644
--- a/t/tests/fields-depends-general/desc
+++ b/t/tests/fields-depends-general/desc
@@ -5,6 +5,7 @@ Description: General tests for package dependencies
 Test-For:
  build-depends-on-metapackage
  build-depends-on-non-build-package
+ build-depends-on-python-dev-with-no-arch-any
  depends-on-metapackage
  lib-recommends-documentation
-References: Debian Bug#540594
+References: Debian Bug#540594, Debian Bug#551793
diff --git a/t/tests/fields-depends-general/tags b/t/tests/fields-depends-general/tags
index 6e0bba2..ac5f549 100644
--- a/t/tests/fields-depends-general/tags
+++ b/t/tests/fields-depends-general/tags
@@ -1,4 +1,5 @@
 E: fields-depends-general source: build-depends-on-metapackage build-depends: xorg-dev
 E: fields-depends-general source: build-depends-on-non-build-package build-depends: java-propose-classpath
 E: fields-depends-general: depends-on-metapackage depends: xorg
+W: fields-depends-general source: build-depends-on-python-dev-with-no-arch-any
 W: libfields-depends-general: lib-recommends-documentation recommends: debconf-doc

-- 
Debian package checker


Reply to: