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

[SCM] Debian package checker branch, master, updated. 2.2.18-44-gaa22449



The following commit has been merged in the master branch:
commit a1bd55f4966c141293d08e63284098359d583a85
Author: Russ Allbery <rra@debian.org>
Date:   Thu Dec 24 13:45:37 2009 -0800

    Remove build-depends-without-arch-dep
    
    * checks/rules{,.desc}:
      + [RA] Remove build-depends-without-arch-dep.  If the package only
        builds architecture-independent packages, the distinction between
        Build-Depends and Build-Depends-Indep is meaningless and there's no
        reason, even pedantically, to worry about the separation.  Thanks,
        Charles Plessy.  (Closes: #552200)

diff --git a/checks/rules b/checks/rules
index ef5eb54..8ecea2c 100644
--- a/checks/rules
+++ b/checks/rules
@@ -51,21 +51,6 @@ our @GLOBAL_CLEAN_DEPENDS =
      [ $PYTHON_DEPEND => qr'/usr/share/cdbs/1/class/python-distutils\.mk', 'missing-python-build-dependency' ],
     );
 
-# These are similar, but the resulting dependency is only allowed, not
-# required.
-#
-# The xsfclean rule is specific to the packages maintained by the X Strike
-# Force, but there are enough of those to make the rule worthwhile.
-my @GLOBAL_CLEAN_ALLOWED = (
-	[ patchutils => qr'^include\s+/usr/share/cdbs/1/rules/dpatch\.mk' ],
-	[ patchutils => qr'^include\s+/usr/share/cdbs/1/rules/patchsys-quilt\.mk' ],
-	[ patchutils => qr'^include\s+/usr/share/cdbs/1/rules/simple-patchsys\.mk' ],
-	[ 'python-central' => qr'^DEB_PYTHON_SYSTEM\s*:?=\s*pycentral' ],
-	[ 'python-support' => qr'^DEB_PYTHON_SYSTEM\s*:?=\s*pysupport' ],
-	[ 'python-setuptools' => qr'/usr/share/cdbs/1/class/python-distutils\.mk' ],
-	[ quilt => qr'^clean:\s+xsfclean\b' ],
-);
-
 # A list of packages; regular expressions that, if they match anywhere in the
 # debian/rules file, this package must be listed in either Build-Depends or
 # Build-Depends-Indep as appropriate; and optional tags as above.
@@ -94,28 +79,6 @@ my @RULE_CLEAN_DEPENDS =
      [ yada => qr'^\t\s*yada\s' ],
     );
 
-# Similar, but the resulting dependency is only allowed, not required.  We
-# permit a versioned dependency on perl-base because that used to be the
-# standard suggested dependency.  No package should be depending on just
-# perl-base, since it's Priority: required.
-my @RULE_CLEAN_ALLOWED =
-    (
-     [ patch => q'^\t\s*(?:perl debian/)?yada\s+unpatch' ],
-     [ 'perl | perl-base (>= 5.6.0-16)' => qr'(^\t|\|\|)\s*(perl|\$\(PERL\))\s' ],
-     [ 'perl-modules (>= 5.10) | libmodule-build-perl' => qr'(^\t|\|\|)\s*(perl|\$\(PERL\))\s+Build\b' ],
-     [ 'python-setuptools' => qr'\ssetup\.py\b' ],
-    );
-
-# A simple list of regular expressions which, if they match anywhere in
-# debian/rules, indicate the requirements for debian/rules clean are complex
-# enough that we can't know what packages are permitted in Build-Depends and
-# should bypass the build-depends-without-arch-dep check completely.
-my @GLOBAL_CLEAN_BYPASS =
-    (
-     qr'^include\s*/usr/share/cdbs/1/class/ant\.mk',
-     qr'^\s+(\S+=\S+\s+)*dh\s+'
-    );
-
 # The following targets are required per Policy.
 my %required = map { $_ => 1 }
     qw(build binary binary-arch binary-indep clean);
@@ -163,7 +126,7 @@ tag "debian-rules-not-a-makefile", ""
 # Holds which dependencies are required.  The keys in %needed and
 # %needed_clean are the dependencies; the values are the tags to use or the
 # empty string to use the default tag.
-my (%needed, %needed_clean, %allowed_clean, $bypass_needed_clean);
+my (%needed, %needed_clean);
 
 # Scan debian/rules.  We would really like to let make do this for us, but
 # unfortunately there doesn't seem to be a way to get make to syntax-check and
@@ -213,23 +176,9 @@ while (<RULES>) {
     # Check for strings anywhere in debian/rules that have implications for
     # our dependencies.
     for my $rule (@GLOBAL_CLEAN_DEPENDS) {
-        if (/$rule->[1]/) {
-            if ($maybe_skipping) {
-                $allowed_clean{$rule->[0]} = 1;
-            } else {
-                $needed_clean{$rule->[0]}
-                    = $rule->[2] || $needed_clean{$rule->[0]} || '';
-            }
-        }
-    }
-    for my $rule (@GLOBAL_CLEAN_ALLOWED) {
-        if (/$rule->[1]/) {
-            $allowed_clean{$rule->[0]} = 1;
-        }
-    }
-    for my $rule (@GLOBAL_CLEAN_BYPASS) {
-        if (/$rule/) {
-            $bypass_needed_clean = 1;
+        if (/$rule->[1]/ and not $maybe_skipping) {
+            $needed_clean{$rule->[0]}
+                = $rule->[2] || $needed_clean{$rule->[0]} || '';
         }
     }
     for my $rule (@GLOBAL_DEPENDS) {
@@ -289,18 +238,9 @@ while (<RULES>) {
             }
             if ($arch) {
                 for my $rule (@RULE_CLEAN_DEPENDS) {
-                    if (/$rule->[1]/) {
-                        if ($maybe_skipping) {
-                            $allowed_clean{$rule->[0]} = 1;
-                        } else {
-                            $needed_clean{$rule->[0]}
-                                = $rule->[2] || $needed_clean{$rule->[0]} || '';
-                        }
-                    }
-                }
-                for my $rule (@RULE_CLEAN_ALLOWED) {
-                    if (/$rule->[1]/) {
-                        $allowed_clean{$rule->[0]} = 1;
+                    if (/$rule->[1]/ and not $maybe_skipping) {
+                        $needed_clean{$rule->[0]}
+                            = $rule->[2] || $needed_clean{$rule->[0]} || '';
                     }
                 }
 	    }
@@ -381,44 +321,6 @@ for my $package (keys %needed) {
     }
 }
 
-# This check is a bit tricky.  We want to allow in Build-Depends a dependency
-# with any version, since reporting this tag over version mismatches would be
-# confusing and quite likely wrong.  The approach taken is to strip the
-# version information off all dependencies allowed in Build-Depends, strip the
-# version information off of the dependencies in Build-Depends, and then allow
-# any dependency in Build-Depends that's implied by the dependencies we
-# require or allow there.
-#
-# We also have to map | to , when building the list of allowed packages so
-# that the implications will work properly.
-#
-# This is confusing.  There should be a better way to do this.
-my $arch_dep_packages = 0;
-for my $binpkg (keys %{ $info->binaries } ) {
-    my $arch = $info->binary_field($binpkg, 'architecture');
-    $arch_dep_packages++ unless ($arch eq 'all');
-}
-if (defined $info->field('build-depends') and $arch_dep_packages == 0
-    and not $bypass_needed_clean) {
-    my $build_depends = $info->field('build-depends');
-    my @packages = split /\s*,\s*/, $build_depends;
-    my @allowed = map {
-        s/\([^\)]+\)//g;
-        s/\|/,/g;
-        $_
-    } keys (%needed_clean), keys (%allowed_clean);
-    my $dep = Lintian::Relation->new_noarch(join(',', @allowed));
-    for my $pkg (@packages) {
-        my $name = $pkg;
-        $name =~ s/[\[\(][^\)\]]+[\)\]]//g;
-        $name =~ s/\s+$//;
-        $name =~ s/\s+/ /g;
-        unless ($dep->implies($name)) {
-            tag "build-depends-without-arch-dep", $name;
-        }
-    }
-}
-
 }
 
 1;
diff --git a/checks/rules.desc b/checks/rules.desc
index 6aca658..19fa7c8 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -143,17 +143,6 @@ Info: The package runs dh_python in <tt>debian/rules</tt> but doesn't
  build-depend on python (or python-dev or python-all-dev, which in turn
  depend on python), even if they don't otherwise need Python to build.
 
-Tag: build-depends-without-arch-dep
-Severity: minor
-Certainty: possible
-Ref: policy 7.7
-Info: The control file lists the given package in Build-Depends, but no
- architecture-dependent packages are built. If all the packages built are
- architecture-independent, the only packages that should be listed in
- Build-Depends are those required to run the clean target (such as
- debhelper if you use dh_clean). Other build dependencies should be listed
- in Build-Depends-Indep instead.
-
 Tag: clean-should-be-satisfied-by-build-depends
 Severity: important
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index 79f03fc..0ad798e 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
 lintian (2.3.0) UNRELEASED; urgency=low
 
+  * Summary of tag changes:
+    + Removed:
+      - build-depends-without-arch-dep
+
   * checks/*:
     + [RA] Use Lintian::Tags instead of Tags.
   * checks/binaries:
@@ -16,6 +20,12 @@ lintian (2.3.0) UNRELEASED; urgency=low
     + [ADB] Re-order the fields of build-depends-on-build-essential so that
       all of the descriptive text is included.  Thanks, Jonathan Wiltshire.
       (Closes: #557786)
+  * checks/rules{,.desc}:
+    + [RA] Remove build-depends-without-arch-dep.  If the package only
+      builds architecture-independent packages, the distinction between
+      Build-Depends and Build-Depends-Indep is meaningless and there's no
+      reason, even pedantically, to worry about the separation.  Thanks,
+      Charles Plessy.  (Closes: #552200)
 
   * data/debhelper/*:
     + [ADB] Refresh against unstable.  
diff --git a/t/tests/fields-module-build-allowed/debian/debian/control.in b/t/tests/fields-module-build-allowed/debian/debian/control.in
deleted file mode 100644
index 90f2598..0000000
--- a/t/tests/fields-module-build-allowed/debian/debian/control.in
+++ /dev/null
@@ -1,14 +0,0 @@
-Source: {$srcpkg}
-Priority: extra
-Section: {$section}
-Maintainer: {$author}
-Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7), libmodule-build-perl
-
-Package: {$srcpkg}
-Architecture: {$architecture}
-Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
-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
- things.  It should not be installed like a regular package.
diff --git a/t/tests/fields-module-build-allowed/debian/debian/rules b/t/tests/fields-module-build-allowed/debian/debian/rules
deleted file mode 100755
index a87218a..0000000
--- a/t/tests/fields-module-build-allowed/debian/debian/rules
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/make -f
-#
-# We can't use dh rule minimization, since that intentionally disables the
-# check that we're testing.
-
-build:
-install:
-
-clean:
-	dh_testdir
-	dh_testroot
-	[ ! -f Build ] || $(PERL) Build --allow_mb_mismatch 1 distclean
-	dh_clean
-
-binary: binary-arch binary-indep
-binary-arch:
-binary-indep:
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs
-	dh_installdocs
-	dh_link
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
diff --git a/t/tests/fields-module-build-allowed/desc b/t/tests/fields-module-build-allowed/desc
deleted file mode 100644
index 95716f5..0000000
--- a/t/tests/fields-module-build-allowed/desc
+++ /dev/null
@@ -1,5 +0,0 @@
-Testname: fields-module-build-allowed
-Sequence: 6000
-Version: 1.0
-Description: Test that libmodule-build-perl dependencies are allowed
-Test-Against: build-depends-without-arch-dep
diff --git a/t/tests/fields-module-build-allowed/tags b/t/tests/fields-module-build-allowed/tags
deleted file mode 100644
index e69de29..0000000
diff --git a/t/tests/fields-quilt-debhelper/debian/debian/control.in b/t/tests/fields-quilt-debhelper/debian/debian/control.in
index 513cd02..6307a5a 100644
--- a/t/tests/fields-quilt-debhelper/debian/debian/control.in
+++ b/t/tests/fields-quilt-debhelper/debian/debian/control.in
@@ -3,7 +3,7 @@ Priority: extra
 Section: devel
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: quilt (>= 0.46-7), debhelper (>= 7)
+Build-Depends: quilt, debhelper (>= 7)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/fields-quilt-debhelper/desc b/t/tests/fields-quilt-debhelper/desc
index 92b7c29..e252d31 100644
--- a/t/tests/fields-quilt-debhelper/desc
+++ b/t/tests/fields-quilt-debhelper/desc
@@ -3,5 +3,5 @@ Sequence: 6000
 Type: non-native
 Version: 1.0-1
 Description: Recognize quilt's debhelper add-ons
-Test-Against: build-depends-without-arch-dep
+Test-For: missing-build-dependency
 References: Debian Bug #528003
diff --git a/t/tests/fields-quilt-debhelper/tags b/t/tests/fields-quilt-debhelper/tags
index e69de29..f54c3bd 100644
--- a/t/tests/fields-quilt-debhelper/tags
+++ b/t/tests/fields-quilt-debhelper/tags
@@ -0,0 +1 @@
+E: fields-quilt-debhelper source: missing-build-dependency quilt (>= 0.46-7~)
diff --git a/t/tests/rules-build-dep-pattern/debian/debian/control.in b/t/tests/rules-build-dep-pattern/debian/debian/control.in
index 85d12ac..870e4a1 100644
--- a/t/tests/rules-build-dep-pattern/debian/debian/control.in
+++ b/t/tests/rules-build-dep-pattern/debian/debian/control.in
@@ -3,7 +3,7 @@ Priority: extra
 Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7), python
+Build-Depends: debhelper (>= 7)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/rules-build-dep-pattern/desc b/t/tests/rules-build-dep-pattern/desc
index 5d2d48d..db1a053 100644
--- a/t/tests/rules-build-dep-pattern/desc
+++ b/t/tests/rules-build-dep-pattern/desc
@@ -2,5 +2,5 @@ Testname: rules-build-dep-pattern
 Sequence: 6000
 Version: 1.0
 Description: Check recognition of pattern dependencies
-Test-Against: build-depends-without-arch-dep
+Test-For: missing-python-build-dependency
 References: Bug#536405
diff --git a/t/tests/rules-build-dep-pattern/tags b/t/tests/rules-build-dep-pattern/tags
index e69de29..fc7c181 100644
--- a/t/tests/rules-build-dep-pattern/tags
+++ b/t/tests/rules-build-dep-pattern/tags
@@ -0,0 +1 @@
+E: rules-build-dep-pattern source: missing-python-build-dependency
diff --git a/testset/tags.cdbs-test b/testset/tags.cdbs-test
index 9694f6e..814650c 100644
--- a/testset/tags.cdbs-test
+++ b/testset/tags.cdbs-test
@@ -1,6 +1,5 @@
 E: cdbs-test source: clean-should-be-satisfied-by-build-depends debhelper
 E: cdbs-test source: missing-python-build-dependency
-I: cdbs-test source: build-depends-without-arch-dep yada
 W: cdbs-test source: debian-watch-file-declares-multiple-versions line 3
 W: cdbs-test source: debian-watch-file-unknown-version 4
 W: cdbs-test source: no-human-maintainers
diff --git a/testset/tags.diffs b/testset/tags.diffs
index 6b3d974..33cea69 100644
--- a/testset/tags.diffs
+++ b/testset/tags.diffs
@@ -6,7 +6,6 @@ E: diffs: possible-missing-colon-in-closes Closes #1239124
 E: diffs: possible-missing-colon-in-closes Closes 456712
 E: diffs: possible-missing-colon-in-closes Closes Bug# 123893
 E: diffs: unstripped-binary-or-object ./usr/bin/diffs
-I: diffs source: build-depends-without-arch-dep dpatch
 I: diffs source: debian-watch-file-is-missing
 I: diffs: no-md5sums-control-file
 W: diffs source: ancient-standards-version 3.5.9 (current is 3.8.3)
diff --git a/testset/tags.relations b/testset/tags.relations
index d28bd61..c5d562f 100644
--- a/testset/tags.relations
+++ b/testset/tags.relations
@@ -27,13 +27,6 @@ E: relations: depends-on-essential-package-without-using-version depends: dpkg
 E: relations: depends-on-obsolete-package recommends: gs
 E: relations: needlessly-depends-on-awk pre-depends
 E: relations: no-copyright-file
-I: relations source: build-depends-without-arch-dep arch-test1
-I: relations source: build-depends-without-arch-dep arch-test2
-I: relations source: build-depends-without-arch-dep bar
-I: relations source: build-depends-without-arch-dep findutils
-I: relations source: build-depends-without-arch-dep foo
-I: relations source: build-depends-without-arch-dep libc6-dev
-I: relations source: build-depends-without-arch-dep mail-transport-agent
 I: relations source: ored-build-depends-on-obsolete-package build-depends-indep: gs
 I: relations-multiple-libs: description-synopsis-might-not-be-phrased-properly
 I: relations-multiple-libs: ored-depends-on-obsolete-package suggests: gs

-- 
Debian package checker


Reply to: