The following commit has been merged in the master branch: commit 2dc2e0bc9f146c696c2f36aa17154d5c683be8ee Author: Russ Allbery <r...@debian.org> Date: Tue Dec 30 10:33:03 2008 -0800
Require debhelper tokens in maintainer scripts with dh * checks/debhelper{,.desc}: + [RA] If dh is used, require debhelper tokens in maintainer scripts. diff --git a/checks/debhelper b/checks/debhelper index 3d6a959..811a56e 100644 --- a/checks/debhelper +++ b/checks/debhelper @@ -101,6 +101,7 @@ while (<RULES>) { } elsif (m,^\s+dh\s+,) { $seencommand = 1; $needbuilddepends = 1; + $needtomodifyscripts = 1; $needmiscdepends = 1; push (@versioncheck, 'dh'); } elsif (m,^include\s+/usr/share/cdbs/1/rules/debhelper.mk,) { diff --git a/debian/changelog b/debian/changelog index c7b0f3e..86b23da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ lintian (2.1.4) UNRELEASED; urgency=low + [RA] Check for use of shell brace expansion in debhelper config 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. * checks/menu-format{,.desc}: + [RA] If a *.desktop file contains a MimeType key, check that the postinst calls update-desktop-database. (Closes: #488832) diff --git a/t/tests/6000_debhelper-script-token-unneeded.desc b/t/tests/6000_debhelper-script-token-unneeded.desc new file mode 100644 index 0000000..8e37818 --- /dev/null +++ b/t/tests/6000_debhelper-script-token-unneeded.desc @@ -0,0 +1,4 @@ +Testname: debhelper-script-token-unneeded +Version: 1.0 +Description: Check unnecessary debhelper script token +Test-Against: maintainer-script-lacks-debhelper-token diff --git a/t/tests/6000_debhelper-script-token.desc b/t/tests/6000_debhelper-script-token.desc new file mode 100644 index 0000000..9ea703f --- /dev/null +++ b/t/tests/6000_debhelper-script-token.desc @@ -0,0 +1,4 @@ +Testname: debhelper-script-token +Version: 1.0 +Description: Check debhelper script token with rule minimization +Test-For: maintainer-script-lacks-debhelper-token diff --git a/t/tests/debhelper-script-token-unneeded/debian/debian/postinst b/t/tests/debhelper-script-token-unneeded/debian/debian/postinst new file mode 100644 index 0000000..185dc3a --- /dev/null +++ b/t/tests/debhelper-script-token-unneeded/debian/debian/postinst @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +run something + +# We should have a debhelper token. +exit 0 diff --git a/t/tests/debhelper-script-token-unneeded/debian/debian/rules b/t/tests/debhelper-script-token-unneeded/debian/debian/rules new file mode 100755 index 0000000..bbd9fb3 --- /dev/null +++ b/t/tests/debhelper-script-token-unneeded/debian/debian/rules @@ -0,0 +1,34 @@ +#!/usr/bin/make -f +# +# Use an alternate rules file that doesn't call dh to test not warning +# about debhelper script tokens if we call no programs that care about +# them. + +pkg = $(shell dh_listpackages) + +build: + +clean: + dh_testdir + dh_testroot + dh_clean + +binary: binary-indep binary-arch +binary-arch: +binary-indep: + dh_testdir + dh_testroot + dh_prep + dh_install + dh_installchangelogs + # dh_installdocs may modify maintainer scripts + install -m 644 debian/copyright debian/$(pkg)/usr/share/doc/$(pkg) + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +.PHONY: binary binary-arch binary-indep build clean diff --git a/t/tests/basic-non-native/tags b/t/tests/debhelper-script-token-unneeded/tags similarity index 100% copy from t/tests/basic-non-native/tags copy to t/tests/debhelper-script-token-unneeded/tags diff --git a/t/tests/debhelper-script-token/debian/debian/postinst b/t/tests/debhelper-script-token/debian/debian/postinst new file mode 100644 index 0000000..185dc3a --- /dev/null +++ b/t/tests/debhelper-script-token/debian/debian/postinst @@ -0,0 +1,6 @@ +#!/bin/sh +set -e +run something + +# We should have a debhelper token. +exit 0 diff --git a/t/tests/debhelper-script-token/tags b/t/tests/debhelper-script-token/tags new file mode 100644 index 0000000..25d0b74 --- /dev/null +++ b/t/tests/debhelper-script-token/tags @@ -0,0 +1 @@ +W: debhelper-script-token source: maintainer-script-lacks-debhelper-token debian/postinst diff --git a/t/tests/menu-format-desktop-mimetype/tags b/t/tests/menu-format-desktop-mimetype/tags index f49d105..1f554cd 100644 --- a/t/tests/menu-format-desktop-mimetype/tags +++ b/t/tests/menu-format-desktop-mimetype/tags @@ -1 +1,2 @@ +W: menu-format-desktop-mimetype source: maintainer-script-lacks-debhelper-token debian/postinst W: menu-format-desktop-mimetype: desktop-mimetype-without-update-call /usr/share/applications/foo.desktop diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postinst b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postinst index 5f9cb7d..42a9de5 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postinst +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postinst @@ -5,3 +5,6 @@ This is here to fool Lintian to avoid additional tags about debconf. . /usr/share/debconf/confmodule """ sys.exit(0) +""" +#DEBHELPER# +""" diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postrm b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postrm index 61e0d12..39aa8ed 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postrm +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-forbidden.postrm @@ -5,3 +5,6 @@ This is here to fool Lintian to avoid additional tags about debconf. db_purge """ sys.exit(0) +""" +#DEBHELPER# +""" diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-paths.prerm b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-paths.prerm index 4267164..b2c6828 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-paths.prerm +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-paths.prerm @@ -1,3 +1,6 @@ #!/bin/python import sys sys.exit(0) +""" +#DEBHELPER# +""" diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.postinst b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.postinst index f540a5b..08e9923 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.postinst +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.postinst @@ -1,3 +1,6 @@ #!/usr/bin/python import sys sys.exit(0) +""" +#DEBHELPER# +""" diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.preinst b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.preinst index f540a5b..08e9923 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.preinst +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-prepython.preinst @@ -1,3 +1,6 @@ #!/usr/bin/python import sys sys.exit(0) +""" +#DEBHELPER# +""" diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.postinst b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.postinst index f540a5b..08e9923 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.postinst +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.postinst @@ -1,3 +1,6 @@ #!/usr/bin/python import sys sys.exit(0) +""" +#DEBHELPER# +""" diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.preinst b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.preinst index f540a5b..08e9923 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.preinst +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-python.preinst @@ -1,3 +1,6 @@ #!/usr/bin/python import sys sys.exit(0) +""" +#DEBHELPER# +""" diff --git a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-unknown.postinst b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-unknown.postinst index 9e1804f..a5ded5a 100644 --- a/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-unknown.postinst +++ b/t/tests/scripts-control-interpreters/debian/debian/scripts-control-interpreters-unknown.postinst @@ -1,3 +1,6 @@ #!/usr/bin/unknown do the unknown thing +shellicate this stuff ( +#DEBHELPER# +) yay! exit happily -- Debian package checker -- To UNSUBSCRIBE, email to debian-lint-maint-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org