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

[lintian] 01/01: [CL] Check for files setting DH_BUILD_OPTIONS instead of DH_BUILD_MAINT_OPTIONS. (Closes: #833691)



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

lamby pushed a commit to branch master
in repository lintian.

commit a2accfc84c96351956042174413c472e2e644775
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Jul 11 23:07:01 2017 +0100

    [CL] Check for files setting DH_BUILD_OPTIONS instead of DH_BUILD_MAINT_OPTIONS. (Closes: #833691)
---
 checks/rules.desc                                      | 9 +++++++++
 checks/rules.pm                                        | 4 ++++
 debian/changelog                                       | 2 ++
 t/tests/debhelper-dh-build-options/debian/debian/rules | 7 +++++++
 t/tests/debhelper-dh-build-options/desc                | 5 +++++
 t/tests/debhelper-dh-build-options/tags                | 1 +
 6 files changed, 28 insertions(+)

diff --git a/checks/rules.desc b/checks/rules.desc
index 8c352ea..e4fd6b5 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -134,6 +134,15 @@ Info: As of debhelper version 4, the DH_COMPAT environment variable is
  line in <tt>debian/rules</tt> that sets it globally should be deleted and
  a separate <tt>debian/compat</tt> file created if needed.
 
+Tag: debian-rules-sets-DH_BUILD_OPTIONS
+Severity: normal
+Certainty: certain
+Ref: dpkg-buildflags(1)
+Info: The <tt>debian/rules</tt> file sets the DH_BUILD_OPTIONS variable,
+ which will override any user-specified build profile.
+ .
+ Please replace with DH_BUILD_MAINT_OPTIONS.
+
 Tag: binary-arch-rules-but-pkg-is-arch-indep
 Severity: normal
 Certainty: certain
diff --git a/checks/rules.pm b/checks/rules.pm
index 1a1a174..96cb577 100644
--- a/checks/rules.pm
+++ b/checks/rules.pm
@@ -208,6 +208,10 @@ sub run {
             }
         }
 
+        if (/^\s*(?:export\s+)?DH_BUILD_OPTIONS\s*:?=/ && keys(%seen) == 0) {
+            tag 'debian-rules-sets-DH_BUILD_OPTIONS', "line $.";
+        }
+
         # check generic problem
         foreach my $bad_construct ($BAD_CONSTRUCT_IN_RULES->all) {
             my $badregex = $BAD_CONSTRUCT_IN_RULES->value($bad_construct);
diff --git a/debian/changelog b/debian/changelog
index 11d2122..91ae197 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -36,6 +36,8 @@ lintian (2.5.52) UNRELEASED; urgency=medium
   * checks/rules.desc:
     + [CL] Clarify wording in debian-rules-parses-dpkg-parsechangelog to
       make the justification clearer.  (Closes: #865882)
+    + [CL] Check for files setting DH_BUILD_OPTIONS instead of
+      DH_BUILD_MAINT_OPTIONS. (Closes: #833691)
   * checks/udev.{desc,pm}:
     + [NT] New check by Petter Reinholdtsen.
 
diff --git a/t/tests/debhelper-dh-build-options/debian/debian/rules b/t/tests/debhelper-dh-build-options/debian/debian/rules
new file mode 100755
index 0000000..4c4e1a4
--- /dev/null
+++ b/t/tests/debhelper-dh-build-options/debian/debian/rules
@@ -0,0 +1,7 @@
+#!/usr/bin/make -f
+
+export DH_BUILD_OPTIONS=nocheck
+export DEB_BUILD_MAINT_OPTIONS=hardening=+pie,-fortify
+
+%:
+	dh $@
diff --git a/t/tests/debhelper-dh-build-options/desc b/t/tests/debhelper-dh-build-options/desc
new file mode 100644
index 0000000..fa7d85b
--- /dev/null
+++ b/t/tests/debhelper-dh-build-options/desc
@@ -0,0 +1,5 @@
+Testname: debhelper-dh-build-options
+Version: 1.0
+Description: Test the value of DH_BUILD_OPTIONS
+Test-For:
+ debian-rules-sets-DH_BUILD_OPTIONS
diff --git a/t/tests/debhelper-dh-build-options/tags b/t/tests/debhelper-dh-build-options/tags
new file mode 100644
index 0000000..de4b369
--- /dev/null
+++ b/t/tests/debhelper-dh-build-options/tags
@@ -0,0 +1 @@
+W: debhelper-dh-build-options source: debian-rules-sets-DH_BUILD_OPTIONS line 3

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


Reply to: