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

[SCM] Debian package checker branch, master, updated. 2.5.10-230-gf071c71



The following commit has been merged in the master branch:
commit f071c71068f51be3523ed1588af5c214023655fa
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Oct 25 17:16:01 2012 +0200

    c/scripts: Check for unexpanded #DEBHELPER# tokens
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/scripts b/checks/scripts
index edfbb9e..983d8b5 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -533,6 +533,10 @@ while (<SCRIPTS>) {
             $saw_bange = 1;
         }
 
+        if (/\#DEBHELPER\#/) {
+            tag 'maintainer-script-has-unexpanded-debhelper-token', $file;
+        }
+
         next if m,^\s*$,;  # skip empty lines
         next if m,^\s*\#,; # skip comment lines
         $_ = remove_comments($_);
diff --git a/checks/scripts.desc b/checks/scripts.desc
index ccfcb16..66b2b66 100644
--- a/checks/scripts.desc
+++ b/checks/scripts.desc
@@ -672,3 +672,13 @@ Info: This package includes perl scripts using obsoleted perl 4-era
  are likely to be removed from the core in perl 5.16. Please either
  remove references to these libraries, or add a dependency on
  <tt>libperl4-corelibs-perl | perl (&lt;&lt; 5.12.3-7)</tt> to this package.
+
+Tag: maintainer-script-has-unexpanded-debhelper-token
+Severity: normal
+Certainty: possible
+Info: Lintian has detected the presence of a #DEBEHELPER# token in the
+ listed maintainer/control script.  By default, dh_installdeb will remove
+ the token when it makes a substitution in a script.
+ .
+ Please note that dh_installdeb does <i>not</i> substitute the #DEBHELPER#
+ token in udebs.
diff --git a/debian/changelog b/debian/changelog
index 661de81..b009f98 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ lintian (2.5.11) UNRELEASED; urgency=low
       - debug-package-for-multi-arch-same-pkg-not-coinstallable
       - dm-upload-allowed-is-obsolete
       - field-name-typo-in-dep5-copyright
+      - maintainer-script-has-unexpanded-debhelper-token
       - shlibs-uses-obsolete-relation
       - untranslatable-debconf-templates
     + Removed:
@@ -119,6 +120,8 @@ lintian (2.5.11) UNRELEASED; urgency=low
       (Closes: #685497)
     + [NT] Fix false positive "executable-not-elf-or-script" when
       the file is an executable hardlink to a script.
+    + [NT] Check maintainer scripts for unexpanded #DEBHELPER# tokens.
+      Thanks to Cyril "KiBi" Brulebois for the suggestion.
   * checks/source-copyright{,.desc}:
     + [NT] Check for possible misspellings of known field
       names.  (Closes: #678639)
diff --git a/t/COVERAGE b/t/COVERAGE
index 80def48..4055fef 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,5 +1,5 @@
-Last generated 2012-10-22
-Coverage (Tags): 890/968 (91.94%), w. legacy tests: 956/968 (98.76%)
+Last generated 2012-10-25
+Coverage (Tags): 891/969 (91.95%), w. legacy tests: 957/969 (98.76%)
 Coverage (Checks): 33/41 (80.49%), w. legacy tests: 36/41 (87.80%)
 
 The following tags are not tested by the test suite:
diff --git a/t/tests/debconf-maintscripts-deps/debian/debian/rules b/t/tests/debconf-maintscripts-deps/debian/debian/rules
index c51bdaa..e1f0e1b 100644
--- a/t/tests/debconf-maintscripts-deps/debian/debian/rules
+++ b/t/tests/debconf-maintscripts-deps/debian/debian/rules
@@ -11,4 +11,6 @@ override_dh_builddeb:
 	cp -a debian/preinst debian/postinst debian/postrm "$(PKG)/DEBIAN"
 	chmod 0755 "$(PKG)/DEBIAN/preinst" "$(PKG)/DEBIAN/postinst" \
 		   "$(PKG)/DEBIAN/postrm"
+	sed -i '/#DEBHELPER#/ d' "$(PKG)/DEBIAN/preinst" \
+	     "$(PKG)/DEBIAN/postinst" "$(PKG)/DEBIAN/postrm"
 	dh_builddeb
diff --git a/t/tests/debconf-maintscripts-deps/tags b/t/tests/debconf-maintscripts-deps/tags
index 57939eb..8970c72 100644
--- a/t/tests/debconf-maintscripts-deps/tags
+++ b/t/tests/debconf-maintscripts-deps/tags
@@ -1,4 +1,4 @@
-W: debconf-maintscripts-deps: loads-obsolete-confmodule postrm:7 /usr/share/debconf/confmodule.sh
+W: debconf-maintscripts-deps: loads-obsolete-confmodule postrm:6 /usr/share/debconf/confmodule.sh
 W: debconf-maintscripts-deps: missing-debconf-dependency-for-preinst
 W: debconf-maintscripts-deps: postinst-does-not-load-confmodule
 W: debconf-maintscripts-deps: postinst-uses-db-input
diff --git a/t/tests/scripts-maintainer-general/debian/debian/rules b/t/tests/scripts-maintainer-general/debian/debian/rules
new file mode 100644
index 0000000..6f66b82
--- /dev/null
+++ b/t/tests/scripts-maintainer-general/debian/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@
+
+override_dh_installdeb:
+	dh_installdeb
+	echo "#DEBHELPER#" >> debian/$(shell dh_listpackages)/DEBIAN/postinst
diff --git a/t/tests/scripts-maintainer-general/desc b/t/tests/scripts-maintainer-general/desc
index 3e21ef4..03677d8 100644
--- a/t/tests/scripts-maintainer-general/desc
+++ b/t/tests/scripts-maintainer-general/desc
@@ -12,6 +12,7 @@ Test-For:
  gconftool-used-in-maintainer-script
  install-info-used-in-maintainer-script
  install-sgmlcatalog-deprecated
+ maintainer-script-has-unexpanded-debhelper-token
  maintainer-script-hides-init-failure
  maintainer-script-modifies-inetd-conf
  maintainer-script-modifies-ld-so-conf
diff --git a/t/tests/scripts-maintainer-general/tags b/t/tests/scripts-maintainer-general/tags
index 5dbdee4..2d08ef5 100644
--- a/t/tests/scripts-maintainer-general/tags
+++ b/t/tests/scripts-maintainer-general/tags
@@ -19,6 +19,7 @@ W: scripts-maintainer-general: deprecated-chown-usage postinst:84 'chown -R root
 W: scripts-maintainer-general: fc-cache-used-in-maintainer-script postinst:95
 W: scripts-maintainer-general: gconftool-used-in-maintainer-script postinst:44
 W: scripts-maintainer-general: install-info-used-in-maintainer-script postinst:105
+W: scripts-maintainer-general: maintainer-script-has-unexpanded-debhelper-token postinst
 W: scripts-maintainer-general: maintainer-script-hides-init-failure postinst:31
 W: scripts-maintainer-general: maintainer-script-needs-depends-on-gconf2 postinst
 W: scripts-maintainer-general: maintainer-script-needs-depends-on-ucf postinst
diff --git a/t/tests/shared-libs-ldconfig-scripts/debian/debian/rules b/t/tests/shared-libs-ldconfig-scripts/debian/debian/rules
index ba9524f..0d8a94b 100755
--- a/t/tests/shared-libs-ldconfig-scripts/debian/debian/rules
+++ b/t/tests/shared-libs-ldconfig-scripts/debian/debian/rules
@@ -9,6 +9,7 @@ override_dh_builddeb:
 	    if [ -f debian/$${P}.$${S} ] ; then \
 	      cp -af debian/$${P}.$${S} debian/$${P}/DEBIAN/$${S} ; \
 	      chmod 0755 debian/$${P}/DEBIAN/$${S} ; \
+	      sed -i '/#DEBHELPER#/ d' debian/$${P}/DEBIAN/$${S} ; \
 	    fi ; \
 	  done ; \
 	done
diff --git a/testset/tags.scripts b/testset/tags.scripts
index 1ad7756..2b694f0 100644
--- a/testset/tags.scripts
+++ b/testset/tags.scripts
@@ -81,6 +81,7 @@ W: scripts: init.d-script-missing-lsb-keyword etc/init.d/lsb-broken required-sta
 W: scripts: init.d-script-missing-lsb-section etc/init.d/no-lsb
 W: scripts: init.d-script-not-marked-as-conffile etc/init.d/skeleton
 W: scripts: maintainer-script-empty preinst
+W: scripts: maintainer-script-has-unexpanded-debhelper-token preinst
 W: scripts: maintainer-script-ignores-errors postinst
 W: scripts: non-standard-executable-perm usr/bin/perl-bizarre-3 0754 != 0755
 W: scripts: non-standard-setuid-executable-perm usr/bin/suidperlfoo 4555

-- 
Debian package checker


Reply to: