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

[lintian] 01/01: Check for debian/rules files that are dh_make templates. (Closes: #679124)



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit d0fec9183b5977fa8f5e0a779631bb140ee3415d
Author: Chris Lamb <lamby@debian.org>
Date:   Mon Feb 5 22:41:52 2018 +0000

    Check for debian/rules files that are dh_make templates. (Closes: #679124)
---
 checks/rules.desc                         |  8 ++++++++
 checks/rules.pm                           |  3 +++
 debian/changelog                          |  2 ++
 t/tests/rules-general/debian/debian/rules |  3 +++
 t/tests/rules-general/desc                |  1 +
 t/tests/rules-general/tags                | 11 ++++++-----
 6 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/checks/rules.desc b/checks/rules.desc
index 4e89148..b22aa06 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -337,3 +337,11 @@ Info: The <tt>debian/rules</tt> file for this package has a call to
  .
  Please remove the call and let dpkg-deb(1) select suitable defaults.
 Ref: #829100, dpkg-deb(1)
+
+Tag: debian-rules-is-dh_make-template
+Severity: important
+Certainty: certain
+Info: The debian/rules file appears to be an unmodified or insufficiently
+ modified copy of the dh_make template.
+ .
+ Please double-check the rules file.
diff --git a/checks/rules.pm b/checks/rules.pm
index 8f70f7e..559e72e 100644
--- a/checks/rules.pm
+++ b/checks/rules.pm
@@ -177,6 +177,9 @@ sub run {
         }
         my $line = $_;
 
+        tag 'debian-rules-is-dh_make-template'
+          if $. == 2 and $line eq "# See debhelper(7) (uncomment to enable)\n";
+
         next if /^\s*\#/;
         if (m/^\s*[s-]?include\s+(\S++)/o){
             my $makefile = $1;
diff --git a/debian/changelog b/debian/changelog
index ffd05d2..749e90c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,8 @@ lintian (2.5.74) UNRELEASED; urgency=medium
     + [CL] Remove override_dh_auto_test-does-not-check-DEB_BUILD_PROFILES
       (for now) as there are just too many false-positive cases to check.
       (Closes: #889592)
+    + [CL] Check for debian/rules files that are dh_make templates.
+      (Closes: #679124)
   * checks/scripts.desc:
     + [CL] Improve, elaborate and tidy the long description of the
       maintainer-script-should-not-use-recursive-chown-or-chmod tag.
diff --git a/t/tests/rules-general/debian/debian/rules b/t/tests/rules-general/debian/debian/rules
index a9623ca..0b01dc6 100755
--- a/t/tests/rules-general/debian/debian/rules
+++ b/t/tests/rules-general/debian/debian/rules
@@ -1,4 +1,7 @@
 #!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
 
 DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes
 DH_EXTRA_ADDONS = systemd
diff --git a/t/tests/rules-general/desc b/t/tests/rules-general/desc
index 357ef3d..38e6caa 100644
--- a/t/tests/rules-general/desc
+++ b/t/tests/rules-general/desc
@@ -3,6 +3,7 @@ Version: 1.0
 Description: Test various debian/rules checks
 Test-For:
  clean-should-be-satisfied-by-build-depends
+ debian-rules-is-dh_make-template
  debian-rules-should-not-automatically-update-control
  debian-rules-should-not-use-DEB_BUILD_OPTS
  debian-rules-should-not-use-DH_EXTRA_ADDONS
diff --git a/t/tests/rules-general/tags b/t/tests/rules-general/tags
index 800c2d8..906841b 100644
--- a/t/tests/rules-general/tags
+++ b/t/tests/rules-general/tags
@@ -1,6 +1,7 @@
 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 11
-W: rules-general source: debian-rules-should-not-use-DH_EXTRA_ADDONS systemd (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
+E: rules-general source: debian-rules-is-dh_make-template
+E: rules-general source: debian-rules-should-not-automatically-update-control line 6
+W: rules-general source: debian-rules-should-not-use-DEB_BUILD_OPTS line 14
+W: rules-general source: debian-rules-should-not-use-DH_EXTRA_ADDONS systemd (line 7)
+W: rules-general source: debian-rules-should-not-use-pwd line 14
+W: rules-general source: debian-rules-should-not-use-underscore-variable line 15

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: