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

[SCM] Debian package checker branch, master, updated. 2.4.3-107-gdb842aa



The following commit has been merged in the master branch:
commit db842aaf9bfe3140c03e9aa3992462f8eebc2be6
Author: Niels Thykier <niels@thykier.net>
Date:   Fri Dec 24 18:17:17 2010 +0100

    Check for leftover internal debhelper files.
    
      * Summary of tag changes:
        + Added:
          - temporary-debhelper-file
    
      * checks/debhelper{,.desc}:
        + [NT] Added check for temporary debhelper files that ought to have
          been removed by dh_clean.  (Closes: #598251)

diff --git a/checks/debhelper b/checks/debhelper
index 9bd089a..8e59e1d 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -241,6 +241,7 @@ if ($seendhcleank and $level >= 7) {
 
 # Check the files in the debian directory for various debhelper-related
 # things.
+my @indebfiles = ();
 opendir(DEBIAN, 'debfiles')
     or fail("Can't open debfiles directory.");
 while (defined(my $file=readdir(DEBIAN))) {
@@ -303,6 +304,8 @@ while (defined(my $file=readdir(DEBIAN))) {
 	}
     } elsif ($file =~ m/^ex\.|\.ex$/i) {
         tag "dh-make-template-in-source", "debian/$file";
+    } elsif ($file =~ m/^(?:.+\.)?debhelper(?:\.log)?$/){
+	push(@indebfiles, $file);
     } else {
 	my $base = $file;
 	$base =~ s/^[.]+\.//;
@@ -329,6 +332,18 @@ while (defined(my $file=readdir(DEBIAN))) {
 }
 closedir(DEBIAN);
 
+if(scalar(@indebfiles)){
+    my $f = pop(@indebfiles);
+    my $others = scalar(@indebfiles);
+    my $otext = "";
+    if($others > 1){
+	$otext = " and $others others";
+    } elsif($others == 1){
+	$otext = " and 1 other";
+    }
+    tag "temporary-debhelper-file", "$f$otext";
+}
+
 # Check for Python policy usage and the required debhelper dependency for
 # dh_python policy support.  Assume people who intentionally set pycompat to
 # something earlier than 2 know what they're doing.  Skip CDBS packages since
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index 312e78b..bf163d9 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -212,3 +212,13 @@ Info: The debhelper compatibility level specified in <tt>debian/rules</tt>
  methods to generate the compatibility level, write the output into
  <tt>debian/compat</tt> instead of setting DH_COMPAT.  The latter should
  be available for a user to override temporarily.
+
+Tag: temporary-debhelper-file
+Severity: important
+Certainty: certain
+Ref: dh_clean(1)
+Info: The package contains temporary debhelper files, which are normally
+ removed by <tt>dh_clean</tt>. The most common cause for this is that a
+ binary package has been renamed or removed without cleaning the build
+ directory first.
+
diff --git a/debian/changelog b/debian/changelog
index 38a0922..2117252 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ lintian (2.4.4) UNRELEASED; urgency=low
       - unneeded-build-dep-on-quilt
       - description-synopsis-starts-with-article
       - needless-dependency-on-jre
+      - temporary-debhelper-file
 
   * checks/*:
     + [NT] Use the new pre-sorted file {index,info} when iterating over files.
@@ -17,9 +18,11 @@ lintian (2.4.4) UNRELEASED; urgency=low
   * checks/cruft{,.desc}:
     + [NT] Extended the diff-contains-substvars check to also catch files
       prefixed with a package name.
-  * checks/debhelper:
+  * checks/debhelper{,.desc}:
     + [NT] Fix dependency check for dh_nativejava, default-jdk has never
       provided dh_nativejava.  (Closes: #606506)
+    + [NT] Added check for temporary debhelper files that ought to have
+      been removed by dh_clean.  (Closes: #598251)
   * checks/debian-source-dir:
     + [NT] Added missing import of "Util" perl module.  Thanks to David
       Bremner for the patch.
diff --git a/t/tests/debhelper-internal-files/debian/debian/package.debhelper.log b/t/tests/debhelper-internal-files/debian/debian/package.debhelper.log
new file mode 100644
index 0000000..3cb1115
--- /dev/null
+++ b/t/tests/debhelper-internal-files/debian/debian/package.debhelper.log
@@ -0,0 +1 @@
+debhelper log file for package
diff --git a/t/tests/debhelper-internal-files/debian/debian/package.postinst.debhelper b/t/tests/debhelper-internal-files/debian/debian/package.postinst.debhelper
new file mode 100644
index 0000000..1cd1647
--- /dev/null
+++ b/t/tests/debhelper-internal-files/debian/debian/package.postinst.debhelper
@@ -0,0 +1 @@
+Internal debhelper file for package
diff --git a/t/tests/debhelper-internal-files/desc b/t/tests/debhelper-internal-files/desc
new file mode 100644
index 0000000..27f964f
--- /dev/null
+++ b/t/tests/debhelper-internal-files/desc
@@ -0,0 +1,6 @@
+Testname: debhelper-internal-files
+Sequence: 6000
+Version: 1.0
+Description: Test for spotting unremoved debhelper temp files
+Test-For: temporary-debhelper-file
+
diff --git a/t/tests/debhelper-internal-files/tags b/t/tests/debhelper-internal-files/tags
new file mode 100644
index 0000000..4c588be
--- /dev/null
+++ b/t/tests/debhelper-internal-files/tags
@@ -0,0 +1 @@
+E: debhelper-internal-files source: temporary-debhelper-file package.postinst.debhelper and 1 other

-- 
Debian package checker


Reply to: