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

[lintian] 01/01: c/testsuite.pm: Split up restrictions by comma as well as space



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

abe pushed a commit to branch master
in repository lintian.

commit 72c8a7dea30422e957a4c485c6d91a44be9f4562
Author: Axel Beckert <abe@deuxchevaux.org>
Date:   Tue Sep 8 21:02:15 2015 +0200

    c/testsuite.pm: Split up restrictions by comma as well as space
    
    Closes: #798359, #792418
---
 checks/testsuite.pm                                   | 6 +++++-
 debian/changelog                                      | 3 +++
 t/tests/testsuite-general/debian/debian/tests/control | 4 ++++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/checks/testsuite.pm b/checks/testsuite.pm
index d5368d4..8def6ff 100644
--- a/checks/testsuite.pm
+++ b/checks/testsuite.pm
@@ -148,7 +148,11 @@ sub check_control_paragraph {
     }
 
     if (exists $paragraph->{'restrictions'}) {
-        for my $restriction (split ' ', $paragraph->{'restrictions'}) {
+        my $restrictions = $paragraph->{'restrictions'};
+        # Trim leading and trailing whitepace before splitting
+        $restrictions =~ s/^\s+//;
+        $restrictions =~ s/\s+$//;
+        for my $restriction (split /\s*,\s*|\s+/ms, $restrictions) {
             if (not exists $KNOWN_RESTRICTIONS{$restriction}) {
                 tag 'unknown-runtime-tests-restriction', $restriction,
                   'paragraph starting at line', $line;
diff --git a/debian/changelog b/debian/changelog
index 2f552f3..f0b25a3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -49,6 +49,9 @@ lintian (2.5.37) UNRELEASED; urgency=medium
       packaging.  (Closes: #793503)
   * checks/scripts.pm:
     + [BR] Fix Unescaped left brace in regex.  (Closes: #788926)
+  * checks/testsuite.pm:
+    + [AB] Split up restrictions by comma as well as space.
+      (Closes: #798359, #792418)
   * checks/version-substvars.pm:
     + [BR] Fix Unescaped left brace in regex is deprecated line 68.
   * checks/watch.desc:
diff --git a/t/tests/testsuite-general/debian/debian/tests/control b/t/tests/testsuite-general/debian/debian/tests/control
index 070eddc..2755664 100644
--- a/t/tests/testsuite-general/debian/debian/tests/control
+++ b/t/tests/testsuite-general/debian/debian/tests/control
@@ -23,3 +23,7 @@ Depends: @
 
 Features: unknownfeature
 Restrictions: unknownrestriction
+
+Test-Command: /bin/true
+Restrictions: breaks-testbed, rw-build-tree, needs-root
+Depends: @

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


Reply to: