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

[SCM] Debian package checker branch, master, updated. 2.4.3-121-g88a7586



The following commit has been merged in the master branch:
commit 88a75866200e9345d5e8c3f9250fc1b98a781731
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Jan 13 23:14:36 2011 +0100

    Added check to catch unused build-depends on cdbs
    
      * Summary of tag changes:
        + Added:
          - unused-build-dependency-on-cdbs
    
      * checks/debhelper{,.desc}:
        + [NT] Added check for unused build dependency on cdbs.  Thanks to
          Jari Aalto for suggesting this.  (Closes: #582769)

diff --git a/checks/debhelper b/checks/debhelper
index 8e59e1d..8701cca 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -74,6 +74,7 @@ open(RULES, '<', "debfiles/rules") or fail("cannot read debian/rules: $!");
 my $maybe_skipping;
 my $dhcompatvalue;
 my @versioncheck;
+my $inclcdbs = 0;
 while (<RULES>) {
     if (/^ifn?(eq|def)\s/) {
         $maybe_skipping++;
@@ -144,6 +145,7 @@ while (<RULES>) {
 	$seencommand = 1;
 	$needbuilddepends = 1;
 	$needtomodifyscripts = 1;
+	$inclcdbs = 1;
 
 	# CDBS sets DH_COMPAT but doesn't export it.  It does, however, create
 	# a debian/compat file if none was found; that logic is handled later.
@@ -160,6 +162,8 @@ while (<RULES>) {
     } elsif (/^override_dh_/) {
 	$needbuilddepends = 1;
 	$overridetargets = 1;
+    } elsif (m,^include\s+/usr/share/cdbs/,){
+	$inclcdbs = 1;
     }
     if (/^\s+dh_python\s/) {
         $seendhpython = 1;
@@ -169,6 +173,12 @@ while (<RULES>) {
 }
 close RULES;
 
+unless ($inclcdbs){
+    my $bdepends = $info->relation('build-depends-all');
+    # Okay - d/rules does not include any file in /usr/share/cdbs/
+    tag "unused-build-dependency-on-cdbs" if ($bdepends->implies("cdbs"));
+}
+
 return unless $seencommand;
 
 my $pkgs = $info->binaries;
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index bf163d9..4d279b4 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -222,3 +222,9 @@ Info: The package contains temporary debhelper files, which are normally
  binary package has been renamed or removed without cleaning the build
  directory first.
 
+Tag: unused-build-dependency-on-cdbs
+Severity: normal
+Certainty: possible
+Info: The package build-depends on cdbs, but does not include any cdbs
+ files in <tt>debian/rules</tt>.
+
diff --git a/debian/changelog b/debian/changelog
index be35b67..5d2254e 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ lintian (2.4.4) UNRELEASED; urgency=low
       - needless-dependency-on-jre
       - temporary-debhelper-file
       - compressed-objects.inv
+      - unused-build-dependency-on-cdbs
 
   * checks/*:
     + [NT] Use the new pre-sorted file {index,info} when iterating over files.
@@ -28,6 +29,8 @@ lintian (2.4.4) UNRELEASED; urgency=low
       provided dh_nativejava.  (Closes: #606506)
     + [NT] Added check for temporary debhelper files that ought to have
       been removed by dh_clean.  (Closes: #598251)
+    + [NT] Added check for unused build dependency on cdbs.  Thanks to
+      Jari Aalto for suggesting this.  (Closes: #582769)
   * checks/debian-source-dir:
     + [NT] Added missing import of "Util" perl module.  Thanks to David
       Bremner for the patch.
diff --git a/t/tests/control-file-duplicate/debian/debian/control.in b/t/tests/control-file-duplicate/debian/debian/control.in
index 254ce4f..40f9600 100644
--- a/t/tests/control-file-duplicate/debian/debian/control.in
+++ b/t/tests/control-file-duplicate/debian/debian/control.in
@@ -4,7 +4,7 @@ Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
 Build-Depends: debhelper (>= 7.0.50~), debhelper
-Build-Depends-Indep: cdbs, foo, cdbs
+Build-Depends-Indep: foobar, foo, foobar
 Build-Conflicts: bar,
  baz,
  bar [i386]
diff --git a/t/tests/control-file-duplicate/tags b/t/tests/control-file-duplicate/tags
index becac80..6546629 100644
--- a/t/tests/control-file-duplicate/tags
+++ b/t/tests/control-file-duplicate/tags
@@ -1,5 +1,5 @@
 P: control-file-duplicate source: duplicate-in-relation-field in control-file-duplicate depends: ${misc:Depends}, ${misc:Depends}
 P: control-file-duplicate source: duplicate-in-relation-field in control-file-duplicate suggests: baz (= 1.0), baz, baz (>= 2.0)
 P: control-file-duplicate source: duplicate-in-relation-field in source build-conflicts: bar, bar [i386]
-P: control-file-duplicate source: duplicate-in-relation-field in source build-depends-indep: cdbs, cdbs
+P: control-file-duplicate source: duplicate-in-relation-field in source build-depends-indep: foobar, foobar
 P: control-file-duplicate source: duplicate-in-relation-field in source build-depends: debhelper (>= 7.0.50~), debhelper
diff --git a/t/tests/debhelper-dh-clean-k-ok/debian/debian/control.in b/t/tests/debhelper-unused-cdbs/debian/debian/control.in
similarity index 92%
copy from t/tests/debhelper-dh-clean-k-ok/debian/debian/control.in
copy to t/tests/debhelper-unused-cdbs/debian/debian/control.in
index 4a5a774..19b8773 100644
--- a/t/tests/debhelper-dh-clean-k-ok/debian/debian/control.in
+++ b/t/tests/debhelper-unused-cdbs/debian/debian/control.in
@@ -3,7 +3,7 @@ Priority: extra
 Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 6)
+Build-Depends: debhelper (>= 7), cdbs
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/debhelper-unused-cdbs/desc b/t/tests/debhelper-unused-cdbs/desc
new file mode 100644
index 0000000..fc9ff49
--- /dev/null
+++ b/t/tests/debhelper-unused-cdbs/desc
@@ -0,0 +1,5 @@
+Testname: debhelper-unused-cdbs
+Sequence: 6000
+Version: 1.0
+Description: Test for unused build-depends on cdbs
+Test-For: unused-build-dependency-on-cdbs
diff --git a/t/tests/debhelper-unused-cdbs/tags b/t/tests/debhelper-unused-cdbs/tags
new file mode 100644
index 0000000..8c1c074
--- /dev/null
+++ b/t/tests/debhelper-unused-cdbs/tags
@@ -0,0 +1 @@
+W: debhelper-unused-cdbs source: unused-build-dependency-on-cdbs

-- 
Debian package checker


Reply to: