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

[SCM] Debian package checker branch, master, updated. 2.1.3-51-g9d369d1



The following commit has been merged in the master branch:
commit 9d369d1ffc1c4bd520bb16dfa4e0ce156e5f2f46
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Thu Jan 1 16:18:57 2009 +0000

    Warn about debhelper >= 7 packages using dh_clean -k
    
    + [ADB] Warn about packages declaring a debhelper compatibility level
      of 7 or above and using dh_clean -k, which has been deprecated in
      favour of dh_prep.

diff --git a/checks/debhelper b/checks/debhelper
index 811a56e..a32fe0f 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -63,6 +63,7 @@ my $compat = 0;
 my $usescdbs = '';
 my $seendhpython = '';
 my $usescdbspython = '';
+my $seendhcleank = '';
 my $needmiscdepends = 0;
 my %missingbdeps;
 
@@ -82,6 +83,9 @@ while (<RULES>) {
 	if ($dhcommand eq 'dh_suidregister') {
 	    tag "dh_suidregister-is-obsolete", "";
 	}
+	if ($dhcommand eq 'dh_clean' and m/\s+\-k(\s+.*)?$/) {
+	    $seendhcleank = 1;
+	}
 	# if command is passed -n, it does not modify the scripts
 	if ($maint_commands->known($dhcommand) and not m/\s+\-n\s+/) {
 	    $needtomodifyscripts = 1;
@@ -274,6 +278,10 @@ if ($needversiondepends < 4) {
     }
 }
 
+if ($seendhcleank and $compat >= 7) {
+    tag "dh-clean-k-is-deprecated";
+}
+
 }
 
 1;
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index 7f99aac..e726e43 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -68,6 +68,15 @@ Ref: dh_suidregister(1)
 Info: suidregister is obsoleted by dpkg-statoverride, so registration of
  files in with dh_suidregister is unnecessary, and even harmful.
 
+Tag: dh-clean-k-is-deprecated
+Severity: normal
+Certainty: certain
+Ref: dh_clean(1)
+Info: This package calls dh_clean -k in its <tt>debian/rules</tt> file
+ and declares a debhelper compatibility version of at least 7.
+ .
+ debhelper 7 deprecated dh_clean -k in favour of dh_prep.
+
 Tag: debhelper-compat-file-is-empty
 Severity: important
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index 0419400..8c88de3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ lintian (2.1.4) UNRELEASED; urgency=low
       - copyright-refers-to-bad-php-license
       - copyright-refers-to-problematic-php-license
       - copyright-with-old-dh-make-debian-copyright
+      - dh-clean-k-is-deprecated
       - desktop-mimetype-without-update-call
       - forbidden-postrm-interpreter
       - games-package-should-be-section-games
@@ -46,6 +47,9 @@ lintian (2.1.4) UNRELEASED; urgency=low
       files that list filenames, which is not supported.  Based on a patch
       from Raphael Geissert.  (Closes: #480939)
     + [RA] If dh is used, require debhelper tokens in maintainer scripts.
+    + [ADB] Warn about packages declaring a debhelper compatibility level
+      of 7 or above and using dh_clean -k, which has been deprecated in
+      favour of dh_prep.
   * checks/fields:
     + [RA] dh-make-php provides a CDBS rule fragment and hence should go
       into Build-Depends, not Build-Depends-Indep.  Thanks, Mathieu
diff --git a/t/tests/6000_debhelper-dh-clean-k-deprecated.desc b/t/tests/6000_debhelper-dh-clean-k-deprecated.desc
new file mode 100644
index 0000000..e8b7ef7
--- /dev/null
+++ b/t/tests/6000_debhelper-dh-clean-k-deprecated.desc
@@ -0,0 +1,5 @@
+Testname: debhelper-dh-clean-k-deprecated
+Version: 1.0
+Description: Test for debhelper >=7 packages using dh_clean -k
+Test-For:
+ dh-clean-k-is-deprecated
diff --git a/t/tests/6000_debhelper-dh-clean-k-ok.desc b/t/tests/6000_debhelper-dh-clean-k-ok.desc
new file mode 100644
index 0000000..aa62848
--- /dev/null
+++ b/t/tests/6000_debhelper-dh-clean-k-ok.desc
@@ -0,0 +1,7 @@
+Testname: debhelper-dh-clean-k-ok
+Version: 1.0
+Description: Test that debhelper < 7 packages can use dh_clean -k
+Test-For:
+ debhelper-but-no-misc-depends
+Test-Against:
+ dh-clean-k-is-deprecated
diff --git a/t/templates/skel/debian/compat b/t/tests/debhelper-dh-clean-k-deprecated/debian/debian/compat
similarity index 100%
copy from t/templates/skel/debian/compat
copy to t/tests/debhelper-dh-clean-k-deprecated/debian/debian/compat
diff --git a/t/templates/skel/debian/control.in b/t/tests/debhelper-dh-clean-k-deprecated/debian/debian/control.in
similarity index 89%
copy from t/templates/skel/debian/control.in
copy to t/tests/debhelper-dh-clean-k-deprecated/debian/debian/control.in
index f8f5c04..ff1a285 100644
--- a/t/templates/skel/debian/control.in
+++ b/t/tests/debhelper-dh-clean-k-deprecated/debian/debian/control.in
@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 7)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
-Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+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
diff --git a/t/tests/debhelper-script-token-unneeded/debian/debian/rules b/t/tests/debhelper-dh-clean-k-deprecated/debian/debian/rules
similarity index 95%
copy from t/tests/debhelper-script-token-unneeded/debian/debian/rules
copy to t/tests/debhelper-dh-clean-k-deprecated/debian/debian/rules
index bbd9fb3..488e728 100755
--- a/t/tests/debhelper-script-token-unneeded/debian/debian/rules
+++ b/t/tests/debhelper-dh-clean-k-deprecated/debian/debian/rules
@@ -18,9 +18,10 @@ binary-arch:
 binary-indep:
 	dh_testdir
 	dh_testroot
-	dh_prep
+	dh_clean -k
 	dh_install
 	dh_installchangelogs
+	dh_installdebconf
 	# dh_installdocs may modify maintainer scripts
 	install -m 644 debian/copyright debian/$(pkg)/usr/share/doc/$(pkg)
 	dh_link
diff --git a/t/tests/debhelper-dh-clean-k-deprecated/tags b/t/tests/debhelper-dh-clean-k-deprecated/tags
new file mode 100644
index 0000000..7914cde
--- /dev/null
+++ b/t/tests/debhelper-dh-clean-k-deprecated/tags
@@ -0,0 +1 @@
+W: debhelper-dh-clean-k-deprecated source: dh-clean-k-is-deprecated
diff --git a/testset/debconf/debian/compat b/t/tests/debhelper-dh-clean-k-ok/debian/debian/compat
similarity index 100%
copy from testset/debconf/debian/compat
copy to t/tests/debhelper-dh-clean-k-ok/debian/debian/compat
diff --git a/t/tests/debhelper-no-depends/debian/debian/control.in b/t/tests/debhelper-dh-clean-k-ok/debian/debian/control.in
similarity index 86%
copy from t/tests/debhelper-no-depends/debian/debian/control.in
copy to t/tests/debhelper-dh-clean-k-ok/debian/debian/control.in
index 32a68ca..3e44f23 100644
--- a/t/tests/debhelper-no-depends/debian/debian/control.in
+++ b/t/tests/debhelper-dh-clean-k-ok/debian/debian/control.in
@@ -3,9 +3,11 @@ Priority: extra
 Section: {$section}
 Maintainer: {$author}
 Standards-Version: 3.8.0
+Build-Depends: debhelper (>= 4)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
+Depends: $\{shlibs: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
diff --git a/t/tests/debhelper-script-token-unneeded/debian/debian/rules b/t/tests/debhelper-dh-clean-k-ok/debian/debian/rules
similarity index 95%
copy from t/tests/debhelper-script-token-unneeded/debian/debian/rules
copy to t/tests/debhelper-dh-clean-k-ok/debian/debian/rules
index bbd9fb3..488e728 100755
--- a/t/tests/debhelper-script-token-unneeded/debian/debian/rules
+++ b/t/tests/debhelper-dh-clean-k-ok/debian/debian/rules
@@ -18,9 +18,10 @@ binary-arch:
 binary-indep:
 	dh_testdir
 	dh_testroot
-	dh_prep
+	dh_clean -k
 	dh_install
 	dh_installchangelogs
+	dh_installdebconf
 	# dh_installdocs may modify maintainer scripts
 	install -m 644 debian/copyright debian/$(pkg)/usr/share/doc/$(pkg)
 	dh_link
diff --git a/t/tests/debhelper-dh-clean-k-ok/tags b/t/tests/debhelper-dh-clean-k-ok/tags
new file mode 100644
index 0000000..88be28f
--- /dev/null
+++ b/t/tests/debhelper-dh-clean-k-ok/tags
@@ -0,0 +1 @@
+W: debhelper-dh-clean-k-ok source: debhelper-but-no-misc-depends debhelper-dh-clean-k-ok
diff --git a/t/tests/generic-dh-make-2008/tags b/t/tests/generic-dh-make-2008/tags
index bd76918..b36ef6d 100644
--- a/t/tests/generic-dh-make-2008/tags
+++ b/t/tests/generic-dh-make-2008/tags
@@ -6,6 +6,7 @@ I: generic-dh-make-2008: extended-description-is-probably-too-short
 I: generic-dh-make-2008: package-contains-empty-directory usr/bin/
 I: generic-dh-make-2008: package-contains-empty-directory usr/sbin/
 W: generic-dh-make-2008 source: bad-homepage <insert the upstream URL, if relevant>
+W: generic-dh-make-2008 source: dh-clean-k-is-deprecated
 W: generic-dh-make-2008 source: dh-make-template-in-source debian/cron.d.ex
 W: generic-dh-make-2008 source: dh-make-template-in-source debian/emacsen-install.ex
 W: generic-dh-make-2008 source: dh-make-template-in-source debian/emacsen-remove.ex

-- 
Debian package checker


Reply to: