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

[SCM] Debian package checker branch, master, updated. 2.2.14-14-g4f5b334



The following commit has been merged in the master branch:
commit 4f5b334297e52b824b102777c11baf96c8d30be6
Author: Russ Allbery <rra@debian.org>
Date:   Sat Sep 12 18:06:21 2009 -0700

    Take into account -p when checking for out-of-order debhelper calls
    
    * checks/rules:
      + [RA] When checking for out-of-order debhelper calls, take into
        account the -p flag and only check within each package.  Thanks,
        Michael Koch.  (Closes: #545219)

diff --git a/checks/rules b/checks/rules
index 5bf103c..32da301 100644
--- a/checks/rules
+++ b/checks/rules
@@ -178,7 +178,7 @@ local $_;
 my @arch_rules = (qr/^clean$/, qr/^binary-arch$/, qr/^build-arch$/);
 my @current_targets;
 my %rules_per_target;
-my $debhelper_group;
+my %debhelper_group;
 my $maybe_skipping;
 while (<RULES>) {
     next if /^\s*\#/;
@@ -269,7 +269,7 @@ while (<RULES>) {
                 push (@arch_rules, @depends);
             }
 	}
-        $debhelper_group = 0;
+        undef %debhelper_group;
     } elsif (/^define /) {
         # We don't want to think the body of the define is part of the
         # previous rule or we'll get false positives on tags like
@@ -306,12 +306,15 @@ while (<RULES>) {
 	    }
             if (m/^\s+(dh_\S+)\b/ and $debhelper_order{$1}) {
                 my $command = $1;
+                my ($package) = /\s(?:-p|--package=)(\S+)/;
+                $package ||= '';
                 my $group = $debhelper_order{$command};
-                if ($group < $debhelper_group) {
+                $debhelper_group{$package} ||= 0;
+                if ($group < $debhelper_group{$package}) {
                     tag "debian-rules-calls-debhelper-in-odd-order",
                         $command, "(line $.)";
                 } else {
-                    $debhelper_group = $group;
+                    $debhelper_group{$package} = $group;
                 }
             }
 	}
diff --git a/debian/changelog b/debian/changelog
index 25e48bc..da80604 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,6 +35,9 @@ lintian (2.2.15) UNRELEASED; urgency=low
   * checks/rules:
     + [RA] Anchor the dh_quilt regex to not trigger on commented-out
       calls.  Patch from Cesare Tirabassi.  (Closes: #543259)
+    + [RA] When checking for out-of-order debhelper calls, take into
+      account the -p flag and only check within each package.  Thanks,
+      Michael Koch.  (Closes: #545219)
 
   * data/fields/essential:
     + [RA] New list of essential packages.
diff --git a/t/COVERAGE b/t/COVERAGE
index d1fcb9b..55ca350 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,4 +1,4 @@
-Last generated 2009-08-16
+Last generated 2009-09-13
 
 The following tags are not tested by the test suite:
 
@@ -499,7 +499,6 @@ po-debconf unknown-encoding-in-po-file
 
 rules build-depends-without-arch-dep
 rules clean-should-be-satisfied-by-build-depends
-rules debian-rules-calls-debhelper-in-odd-order
 rules debian-rules-uses-pwd
 rules missing-dh_python-build-dependency
 rules missing-python-build-dependency
@@ -644,7 +643,6 @@ cdbs-test
   package-has-a-duplicate-build-relation
 
 debconf
-  debian-rules-calls-debhelper-in-odd-order
   dpatch-build-dep-but-no-patch-list
   invalid-po-file
   loads-obsolete-confmodule
diff --git a/t/tests/rules-dh-order/debian/debian/rules b/t/tests/rules-dh-order/debian/debian/rules
new file mode 100755
index 0000000..8ea3133
--- /dev/null
+++ b/t/tests/rules-dh-order/debian/debian/rules
@@ -0,0 +1,34 @@
+#!/usr/bin/make -f
+%:
+	dh $@
+
+# Test for calling debhelper commands out of order.  We take advantage here
+# of the fact checks/rules doesn't care what target the commands are called
+# from by using several uncalled targets.
+
+reverse:
+	dh_builddeb
+	dh_gencontrol
+	dh_installdeb
+	dh_shlibdeps
+	dh_makeshlibs
+
+shared-order:
+	dh_shlibdeps
+	dh_makeshlibs
+	dh_installdeb
+	dh_gencontrol
+	dh_builddeb
+
+multiple-package:
+	dh_makeshlibs -pfoo
+	dh_shlibdeps -pfoo
+	dh_installdeb -pfoo
+	dh_gencontrol -pfoo
+	dh_builddeb -pfoo
+
+	dh_makeshlibs -pbar
+	dh_gencontrol -pbar
+	dh_installdeb -pbar
+	dh_shlibdeps -pbar
+	dh_builddeb -pbar
diff --git a/t/tests/rules-dh-order/desc b/t/tests/rules-dh-order/desc
new file mode 100644
index 0000000..ba501b9
--- /dev/null
+++ b/t/tests/rules-dh-order/desc
@@ -0,0 +1,5 @@
+Testname: rules-dh-order
+Sequence: 6000
+Version: 1.0
+Description: Test order of dh command invocations
+Test-For: debian-rules-calls-debhelper-in-odd-order
diff --git a/t/tests/rules-dh-order/tags b/t/tests/rules-dh-order/tags
new file mode 100644
index 0000000..5469a66
--- /dev/null
+++ b/t/tests/rules-dh-order/tags
@@ -0,0 +1,5 @@
+W: rules-dh-order source: debian-rules-calls-debhelper-in-odd-order dh_gencontrol (line 11)
+W: rules-dh-order source: debian-rules-calls-debhelper-in-odd-order dh_installdeb (line 12)
+W: rules-dh-order source: debian-rules-calls-debhelper-in-odd-order dh_makeshlibs (line 14)
+W: rules-dh-order source: debian-rules-calls-debhelper-in-odd-order dh_makeshlibs (line 18)
+W: rules-dh-order source: debian-rules-calls-debhelper-in-odd-order dh_shlibdeps (line 13)

-- 
Debian package checker


Reply to: