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

[lintian] 01/01: More improvements to override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS. Thanks dkg and gregoa.



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

lamby pushed a commit to branch master
in repository lintian.

commit f430f02b66e94a5644d3d12fcdf3e5b7c65eccde
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Feb 6 19:39:04 2018 +0000

    More improvements to override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS. Thanks dkg and gregoa.
---
 checks/rules.desc                                           | 10 ++++++----
 checks/rules.pm                                             | 11 +++++++----
 .../debian/debian/rules                                     | 13 +++++++++++--
 .../debian/debian/rules                                     |  8 --------
 .../desc                                                    |  5 -----
 .../tags                                                    |  0
 .../debian/debian/rules                                     |  8 --------
 .../desc                                                    |  5 -----
 .../tags                                                    |  0
 .../debian/debian/rules                                     |  8 --------
 .../desc                                                    |  5 -----
 .../tags                                                    |  0
 12 files changed, 24 insertions(+), 49 deletions(-)

diff --git a/checks/rules.desc b/checks/rules.desc
index a2fff9a..0e8c2cd 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -356,8 +356,8 @@ Info: The <tt>debian/rules</tt> file for this package has an
  check <tt>DEB_BUILD_OPTIONS</tt> against <tt>nocheck</tt>.
  .
  As this check is not automatically performed by debhelper(1), the
- specified testsuite is run regardless of using the <tt>nocheck</tt>
- build profile.
+ specified testsuite is run regardless of another maintainer using
+ the <tt>nocheck</tt> build profile.
  .
  Please add a check such as:
  .
@@ -366,9 +366,11 @@ Info: The <tt>debian/rules</tt> file for this package has an
           ./run-upstream-testsuite
   endif
  .
- Lintian will ignore targets such as:
+ Lintian will ignore comments and other lines such as:
  .
   # Disabled
   : Disabled
-  echo "Disbled"
+  echo "Disabled"
+  mkdir foo/
+  ENV=var dh_auto_test -- ARG=value
 Ref: policy 4.9.1, https://wiki.debian.org/BuildProfileSpec#Registered_profile_names
diff --git a/checks/rules.pm b/checks/rules.pm
index 035bfb5..f7ca735 100644
--- a/checks/rules.pm
+++ b/checks/rules.pm
@@ -443,12 +443,15 @@ sub run {
     }
 
     if (my $line = $overridden{'dh_auto_test'}) {
-        my @lines = grep { $_ !~ m/^\t\s*-?(?::|dh_auto_test|echo)\s+/ }
-          @{$rules_per_target{'override_dh_auto_test'}};
+        my @lines = grep {
+                  $_ !~ m/^\t\s*\:/
+              and $_ !~ m/\bdh_auto_test\b/
+              and $_ !~ m/^\t\s*[-@]?(?:cp|echo|mkdir)/
+        }@{$rules_per_target{'override_dh_auto_test'}};
+        warn @lines;
         tag 'override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS',
           "(line $line)"
-          if @lines
-          and none { m/(DEB_BUILD_OPTIONS|nocheck)/ } @conditionals;
+          if @lines and none { m/(DEB_BUILD_OPTIONS|nocheck)/ } @conditionals;
     }
 
     # Make sure that all the required build dependencies are there.  Don't
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-c/debian/debian/rules b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-c/debian/debian/rules
index 3a9fd80..7fa96c3 100755
--- a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-c/debian/debian/rules
+++ b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-c/debian/debian/rules
@@ -3,6 +3,15 @@
 %:
 	dh $@
 
-# Calls parent with arguments
 override_dh_auto_test:
-	dh_auto_test -- VERBOSE=1
+	dh_auto_test
+	dh_auto_test # Comment
+	mkdir ignore/
+	-dh_auto_test -- SUFFIX=1
+	@dh_auto_test -- SUFFIX=1
+	-cp -r ignore ignore/
+	FOO=mydir dh_auto_test -- BAR=2
+	: Disabled
+	echo "Disabled"
+	@echo "Disabled"
+	-echo "Disabled"
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/debian/debian/rules b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/debian/debian/rules
deleted file mode 100755
index 84f382c..0000000
--- a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/debian/debian/rules
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/make -f
-
-%:
-	dh $@
-
-# Disbled via colon
-override_dh_auto_test:
-	: Disabled
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/desc b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/desc
deleted file mode 100644
index 21d18ba..0000000
--- a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/desc
+++ /dev/null
@@ -1,5 +0,0 @@
-Testname: rules-dh-auto-test-does-not-check-deb-build-options-unrel-d
-Version: 1.0
-Description: Test for missing checks for DEB_BUILD_PROFILES (false-positive)
-Test-Against:
- override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/tags b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-d/tags
deleted file mode 100644
index e69de29..0000000
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/debian/debian/rules b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/debian/debian/rules
deleted file mode 100755
index 426f78f..0000000
--- a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/debian/debian/rules
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/make -f
-
-%:
-	dh $@
-
-# Disabled via echo
-override_dh_auto_test:
-	echo "Disabled"
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/desc b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/desc
deleted file mode 100644
index f6d976d..0000000
--- a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/desc
+++ /dev/null
@@ -1,5 +0,0 @@
-Testname: rules-dh-auto-test-does-not-check-deb-build-options-unrel-e
-Version: 1.0
-Description: Test for missing checks for DEB_BUILD_PROFILES (false-positive)
-Test-Against:
- override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/tags b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-e/tags
deleted file mode 100644
index e69de29..0000000
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/debian/debian/rules b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/debian/debian/rules
deleted file mode 100755
index ac1a1d0..0000000
--- a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/debian/debian/rules
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/make -f
-
-%:
-	dh $@
-
-# Ignore result
-override_dh_auto_test:
-	-dh_auto_test -- VERBOSE=1
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/desc b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/desc
deleted file mode 100644
index 449a475..0000000
--- a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/desc
+++ /dev/null
@@ -1,5 +0,0 @@
-Testname: rules-dh-auto-test-does-not-check-deb-build-options-unrel-f
-Version: 1.0
-Description: Test for missing checks for DEB_BUILD_PROFILES (false-positive)
-Test-Against:
- override_dh_auto_test-does-not-check-DEB_BUILD_OPTIONS
diff --git a/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/tags b/t/tests/rules-dh-auto-test-does-not-check-deb-build-options-unrel-f/tags
deleted file mode 100644
index e69de29..0000000

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


Reply to: