This is an automated email from the git hooks/post-receive script. lamby pushed a commit to branch master in repository lintian.
commit 4d4cb5c492067e04ee6957c476c112f988b51760 Author: Paul Tagliamonte <[email protected]> Date: Fri Dec 29 21:45:43 2017 +0000 Add a check for DH_EXTRA_ADDON usage in rules files. The DH_EXTRA_ADDON environment variable was added to debhelper for local and/or downstream use. Use in a rules file is almost universally wrong and a massive anti-pattern. The --with argument should be used in it's place. Signed-off-by: Chris Lamb <[email protected]> --- checks/rules.desc | 8 ++++++++ data/rules/rules-should-not-use | 1 + debian/changelog | 2 ++ t/tests/rules-general/debian/debian/rules | 1 + t/tests/rules-general/desc | 1 + t/tests/rules-general/tags | 7 ++++--- 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/checks/rules.desc b/checks/rules.desc index 48a5b65..66571e8 100644 --- a/checks/rules.desc +++ b/checks/rules.desc @@ -117,6 +117,14 @@ Info: The standard environment variable for build options is DEB_BUILD_OPTIONS. Usually, referring to DEB_BUILD_OPTS is a mistake and DEB_BUILD_OPTIONS was intended instead. +Tag: debian-rules-should-not-use-DH_EXTRA_ADDONS +Severity: normal +Certainty: certain +Info: The DH_EXTRA_ADDONS variable is designed for local or downstream build + use and not for use in debian/rules + . + dh(1)'s <tt>--with</tt> should be used instead. + Tag: debian-rules-should-not-automatically-update-control Severity: serious Certainty: possible diff --git a/data/rules/rules-should-not-use b/data/rules/rules-should-not-use index 1d88057..098e9d4 100644 --- a/data/rules/rules-should-not-use +++ b/data/rules/rules-should-not-use @@ -5,6 +5,7 @@ # debian-rules-should-not-automatically-update-control ~~ ^\s*DEB_AUTO_UPDATE_DEBIAN_CONTROL\s*=\s*yes debian-rules-should-not-use-DEB_BUILD_OPTS ~~ \$[\(\{]DEB_BUILD_OPTS[\)\}] +debian-rules-should-not-use-DH_EXTRA_ADDONS ~~ ^\s*DH_EXTRA_ADDONS\s*= debian-rules-should-not-use-or-modify-user-only-variable ~~ \bDEB_[^_ \t]+FLAGS_(?:SET|APPEND)\b debian-rules-should-not-use-pwd ~~ \$[\(\{]PWD[\)\}] debian-rules-should-not-use-underscore-variable ~~ \$[\(\{]_[\)\}] diff --git a/debian/changelog b/debian/changelog index 24cb22b..4179516 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ lintian (2.5.67) UNRELEASED; urgency=medium suggestion. + [CL] Include the line number when warning about instances of override_dh_clean targets that are missing calls to dh_clean. + + [CL] Apply patch from Paul Tagliamonte to check for files + that use DH_EXTRA_ADDONS. Thanks! (Closes: #885790) * checks/source-copyright.desc: + [CL] Also mention that we check for NOTICE.gz files when looking for Apache 2.0 packages that do not distribute their accompanying NOTICE diff --git a/t/tests/rules-general/debian/debian/rules b/t/tests/rules-general/debian/debian/rules index cddbc03..a9623ca 100755 --- a/t/tests/rules-general/debian/debian/rules +++ b/t/tests/rules-general/debian/debian/rules @@ -1,6 +1,7 @@ #!/usr/bin/make -f DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes +DH_EXTRA_ADDONS = systemd %: dh $@ diff --git a/t/tests/rules-general/desc b/t/tests/rules-general/desc index 8df1535..357ef3d 100644 --- a/t/tests/rules-general/desc +++ b/t/tests/rules-general/desc @@ -5,5 +5,6 @@ Test-For: clean-should-be-satisfied-by-build-depends debian-rules-should-not-automatically-update-control debian-rules-should-not-use-DEB_BUILD_OPTS + debian-rules-should-not-use-DH_EXTRA_ADDONS debian-rules-should-not-use-pwd debian-rules-should-not-use-underscore-variable \ No newline at end of file diff --git a/t/tests/rules-general/tags b/t/tests/rules-general/tags index 3e7351b..660bfec 100644 --- a/t/tests/rules-general/tags +++ b/t/tests/rules-general/tags @@ -1,5 +1,6 @@ E: rules-general source: clean-should-be-satisfied-by-build-depends debhelper E: rules-general source: debian-rules-should-not-automatically-update-control line 3 -W: rules-general source: debian-rules-should-not-use-DEB_BUILD_OPTS line 10 -W: rules-general source: debian-rules-should-not-use-pwd line 10 -W: rules-general source: debian-rules-should-not-use-underscore-variable line 11 +W: rules-general source: debian-rules-should-not-use-DEB_BUILD_OPTS line 11 +W: rules-general source: debian-rules-should-not-use-DH_EXTRA_ADDONS line 4 +W: rules-general source: debian-rules-should-not-use-pwd line 11 +W: rules-general source: debian-rules-should-not-use-underscore-variable line 12 -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git

