Author: rra
Date: 2006-04-23 00:40:29 +0200 (Sun, 23 Apr 2006)
New Revision: 628

Modified:
   trunk/checks/fields
   trunk/checks/fields.desc
   trunk/debian/changelog
   trunk/testset/scripts/debian/control
   trunk/testset/scripts/debian/rules
   trunk/testset/tags.cdbs-test
   trunk/testset/tags.debconf
   trunk/testset/tags.scripts
Log:
The "brown paper Python" release
* checks/fields:
  + [RA] Redo handling of build dependencies to allow a custom tag to be
    specified and to allow a general dependency string to be required
    rather than a simple package name.  As a result, dh_python handling
    is no longer a buggy special case.  Allow either python or
    python-dev for dh_python and the cdbs Python rules.  Thanks, Torsten
    Merek and Aaron M. Ucko.  (Closes: #364297, #364330)
  + [RA] Require at least quilt 0.40 if /usr/share/quilt/quilt.make is
    included.  Thanks, Michele Baldessari.

Modified: trunk/checks/fields
===================================================================
--- trunk/checks/fields 2006-04-21 16:57:11 UTC (rev 627)
+++ trunk/checks/fields 2006-04-22 22:40:29 UTC (rev 628)
@@ -32,29 +32,30 @@
 
 # Certain build tools must be listed in Build-Depends even if there are no
 # arch-specific packages because they're required in order to run the clean
-# rule.  (See Policy 7.6.)  The following is a list of pairs of packages and
+# rule.  (See Policy 7.6.)  The following is a list of package dependencies;
 # regular expressions that, if they match anywhere in the debian/rules file,
-# say that this package is allowed (and required) in Build-Depends.
+# say that this package is allowed (and required) in Build-Depends; and
+# optional tags to use for reporting the problem if some information other
+# than the default is required.
 my @global_clean_depends = (
        [ cdbs => '^include\s+/usr/share/cdbs/' ],
        [ dbs => '^include\s+/usr/share/dbs/' ],
        [ debhelper => '^include\s+/usr/share/cdbs/1/rules/debhelper.mk' ],
        [ dpatch => '^include\s+/usr/share/dpatch/' ],
-       [ quilt => '^include\s+/usr/share/quilt/' ]
+       [ 'quilt (>= 0.40)' => '^include\s+/usr/share/quilt/' ]
 );
 
-# A list of pairs of packages and 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.  dh_python is handled
-# later as a special case rather than a literal package.
+# 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.
 my @global_depends = (
-        [ python => '/usr/share/cdbs/1/class/python-distutils.mk' ],
-        [ dh_python => '^\t\s*dh_python\s' ]
+        [ 'python | python-dev' => 
'/usr/share/cdbs/1/class/python-distutils.mk' ],
+        [ 'python | python-dev' => '^\t\s*dh_python\s', 
'missing-dh_python-build-dependency' ]
 );
 
-# Similarly, these pairs of packages and regexes say that if the regex matches
-# in one of clean, build-arch, binary-arch, or a rule they depend on, this
-# package is allowed (and required) in Build-Depends.
+# Similarly, this list of packages, regexes, and optional tags say that if the
+# regex matches in one of clean, build-arch, binary-arch, or a rule they
+# depend on, this package is allowed (and required) in Build-Depends.
 my @rule_clean_depends = (
        [ debhelper => '^\t\s*dh_.+' ],
        [ dpatch => '^\t\s*dpatch\s' ],
@@ -470,6 +471,9 @@
        }
 
        # Search through rules and determine 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);
        open (RULES, "debfiles/rules") or fail("cannot read debfiles/rules: 
$!");
        my $target = "none";
@@ -478,12 +482,12 @@
        while (<RULES>) {
                for my $rule (@global_clean_depends) {
                        if ($_ =~ /$rule->[1]/) {
-                               $needed_clean{$rule->[0]}++;
+                               $needed_clean{$rule->[0]} = $rule->[2] || 
$needed_clean{$rule->[0]} || '';
                        }
                }
                for my $rule (@global_depends) {
                        if ($_ =~ /$rule->[1]/) {
-                               $needed{$rule->[0]}++;
+                               $needed{$rule->[0]} = $rule->[2] || 
$needed{$rule->[0]} || '';
                        }
                }
                if (/^(\S+):(.*)/) {
@@ -495,7 +499,7 @@
                if (grep ($_ eq $target, @rules)) {
                        for my $rule (@rule_clean_depends) {
                                if ($_ =~ /$rule->[1]/) {
-                                       $needed_clean{$rule->[0]}++;
+                                       $needed_clean{$rule->[0]} = $rule->[2] 
|| $needed_clean{$rule->[0]} || '';
                                }
                        }
                }
@@ -570,24 +574,21 @@
        # another test that does that and it would just be a duplicate.
        for my $package (keys %needed_clean) {
                my $dep = Dep::parse($package);
+               my $tag = $needed_clean{$package} || 'missing-build-dependency';
                unless (Dep::implies($depend{'build-depends'}, $dep)) {
                        if (Dep::implies($depend{'build-depends-indep'}, $dep)) 
{
                                tag 
"build-depends-indep-should-be-build-depends", $package;
                        } else {
-                               tag "missing-build-dependency", $package
-                                   if $package ne 'debhelper';
+                               tag $tag, $package if $package ne 'debhelper';
                        }
                }
        }
        for my $package (keys %needed) {
                my $dep = Dep::parse($package);
+               my $tag = $needed{$package} || 'missing-build-dependency';
                unless (Dep::implies($depend{'build-depends'}, $dep)) {
                        unless (Dep::implies($depend{'build-depends-indep'}, 
$dep)) {
-                               if ($package eq 'dh_python') {
-                                       tag 
"missing-dh_python-build-dependency";
-                               } else {
-                                       tag "missing-build-dependency", 
$package;
-                               }
+                               tag $tag, $package;
                        }
                }
        }
@@ -598,7 +599,7 @@
                my @packages = split /\s*,\s*/, $build_depends;
                foreach my $pkg (@packages) {
                        my ($name) = ($pkg =~ /^(\S+)/);
-                       unless ($needed_clean{$name}) {
+                       unless (defined $needed_clean{$name}) {
                                tag "build-depends-without-arch-dep", $name;
                                last;
                        }

Modified: trunk/checks/fields.desc
===================================================================
--- trunk/checks/fields.desc    2006-04-21 16:57:11 UTC (rev 627)
+++ trunk/checks/fields.desc    2006-04-22 22:40:29 UTC (rev 628)
@@ -470,9 +470,10 @@
 Type: error
 Ref: dh_python(1)
 Info: The package runs dh_python in <tt>debian/rules</tt> but doesn't
- build-depend on python. dh_python requires Python to run, so packages
- using dh_python must build-depend on python, even if they don't otherwise
- need Python to build.
+ build-depend on python or python-dev. dh_python requires Python to run,
+ so packages using dh_python must build-depend on python (or python-dev,
+ which in turn depends on python), even if they don't otherwise need
+ Python to build.
 
 Tag: build-conflicts-with-build-dependency
 Type: error

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2006-04-21 16:57:11 UTC (rev 627)
+++ trunk/debian/changelog      2006-04-22 22:40:29 UTC (rev 628)
@@ -1,3 +1,19 @@
+lintian (1.23.18) unstable; urgency=low
+
+  The "brown paper Python" release
+
+  * checks/fields:
+    + [RA] Redo handling of build dependencies to allow a custom tag to be
+      specified and to allow a general dependency string to be required
+      rather than a simple package name.  As a result, dh_python handling
+      is no longer a buggy special case.  Allow either python or
+      python-dev for dh_python and the cdbs Python rules.  Thanks, Torsten
+      Merek and Aaron M. Ucko.  (Closes: #364297, #364330)
+    + [RA] Require at least quilt 0.40 if /usr/share/quilt/quilt.make is
+      included.  Thanks, Michele Baldessari.
+
+ -- Russ Allbery <[EMAIL PROTECTED]>  Sat, 22 Apr 2006 15:34:22 -0700
+
 lintian (1.23.17) unstable; urgency=low
 
   The "happy Nanaimo hacking" release

Modified: trunk/testset/scripts/debian/control
===================================================================
--- trunk/testset/scripts/debian/control        2006-04-21 16:57:11 UTC (rev 
627)
+++ trunk/testset/scripts/debian/control        2006-04-22 22:40:29 UTC (rev 
628)
@@ -3,6 +3,7 @@
 Priority: extra
 Maintainer: Lintian Maintainers <[EMAIL PROTECTED]>
 Uploaders: Jeroen van Wolfelaar <[EMAIL PROTECTED]>, Marc 'HE' Brockschmidt 
<[EMAIL PROTECTED]>
+Build-Depends-Indep: python (>= 2.3), python (<< 2.4)
 Standards-Version: 3.2.1
 
 Package: scripts

Modified: trunk/testset/scripts/debian/rules
===================================================================
--- trunk/testset/scripts/debian/rules  2006-04-21 16:57:11 UTC (rev 627)
+++ trunk/testset/scripts/debian/rules  2006-04-22 22:40:29 UTC (rev 628)
@@ -37,6 +37,10 @@
        echo "#!/bin/sh" > $(tmp)/usr/share/scripts/foo\$$bar
        chmod 755 $(tmp)/usr/share/scripts/foo\$$bar
 
+# Should produce complaints about a missing debhelper dependency, but not a
+# missing Python dependency.
+       dh_python
+
        touch $(tmp)/usr/lib/python2.3/site-packages/test.pyc
        cp debian/changelog $(tmp)/usr/share/doc/scripts/changelog
        gzip -9 $(tmp)/usr/share/doc/scripts/changelog

Modified: trunk/testset/tags.cdbs-test
===================================================================
--- trunk/testset/tags.cdbs-test        2006-04-21 16:57:11 UTC (rev 627)
+++ trunk/testset/tags.cdbs-test        2006-04-22 22:40:29 UTC (rev 628)
@@ -1,5 +1,5 @@
 E: cdbs-test source: build-depends-indep-should-be-build-depends debhelper
-E: cdbs-test source: missing-build-dependency python
+E: cdbs-test source: missing-build-dependency python | python-dev
 E: cdbs-test source: package-lacks-versioned-build-depends-on-debhelper 5
 W: cdbs-test source: build-depends-without-arch-dep yada
 W: cdbs-test source: native-package-with-dash-version

Modified: trunk/testset/tags.debconf
===================================================================
--- trunk/testset/tags.debconf  2006-04-21 16:57:11 UTC (rev 627)
+++ trunk/testset/tags.debconf  2006-04-22 22:40:29 UTC (rev 628)
@@ -1,5 +1,5 @@
 E: debconf source: declares-possibly-conflicting-debhelper-compat-versions 
rules=4 compat=4
-E: debconf source: missing-dh_python-build-dependency
+E: debconf source: missing-dh_python-build-dependency python | python-dev
 E: debconf-test: extended-description-is-empty
 E: debconf-test: mismatch-translated-choices debconf/testmulti choices-de.utf-8
 E: debconf-test: settitle-requires-versioned-depends config

Modified: trunk/testset/tags.scripts
===================================================================
--- trunk/testset/tags.scripts  2006-04-21 16:57:11 UTC (rev 627)
+++ trunk/testset/tags.scripts  2006-04-22 22:40:29 UTC (rev 628)
@@ -1,3 +1,4 @@
+E: scripts source: package-uses-debhelper-but-lacks-build-depends
 E: scripts: calls-suidperl-directly ./usr/bin/suidperlfoo
 E: scripts: missing-dep-for-interpreter lefty => graphviz (./usr/bin/lefty-foo)
 E: scripts: no-copyright-file
@@ -8,6 +9,7 @@
 E: scripts: wrong-path-for-ruby ./usr/bin/rubyfoo #!/bin/ruby1.8
 W: scripts source: ancient-standards-version 3.2.1
 W: scripts source: changelog-should-mention-nmu
+W: scripts source: package-uses-deprecated-debhelper-compat-version 1
 W: scripts source: source-nmu-has-incorrect-version-number 6
 W: scripts: binary-without-manpage lefty-foo
 W: scripts: binary-without-manpage make-foo


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to