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

[lintian] 01/01: T::L::Harness: Handle "error: " string in dpkg-checkbuilddeps output



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

nthykier pushed a commit to branch master
in repository lintian.

commit f724e5b6fa4e25a9676ae8766269640c09856fb7
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Nov 1 20:06:16 2015 +0100

    T::L::Harness: Handle "error: " string in dpkg-checkbuilddeps output
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 lib/Test/Lintian/Harness.pm | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lib/Test/Lintian/Harness.pm b/lib/Test/Lintian/Harness.pm
index 4089acc..bd21927 100644
--- a/lib/Test/Lintian/Harness.pm
+++ b/lib/Test/Lintian/Harness.pm
@@ -193,6 +193,7 @@ sub check_test_depends {
     # dpkg-checkbuilddeps requires that the Source: field is present.
     print {$test_fd} "Source: bd-test-pkg\n";
     print {$test_fd} "Build-Depends: $testdata->{'test-depends'}\n";
+    close($test_fd);
 
     $pid = open($fd, '-|');
     if (!$pid) {
@@ -205,13 +206,10 @@ sub check_test_depends {
     eval {close($fd);};
     $err = $@;
     unlink($test_file);
-    if ($err) {
-        # Problem closing the pipe?
-        fail "close pipe: $err" if $err->errno;
-        # Else we presume that dpkg-checkbuilddeps concluded missing
-        # build-dependencies
-        $missing =~ s{\A dpkg-checkbuilddeps: [ ]
-                         Unmet [ ] build [ ] dependencies: \s* }{}xsm;
+    if (
+        $missing =~ s{\A dpkg-checkbuilddeps: [ ] (?:error: [ ])?
+                         Unmet [ ] build [ ] dependencies: \s* }{}xsm
+      ) {
         chomp($missing);
         if ($missing =~ s{\n}{\\n}gxsm) {
             # We expect exactly one line.
@@ -219,6 +217,11 @@ sub check_test_depends {
         }
         return $missing;
     }
+    if ($err) {
+        # Problem closing the pipe?
+        fail "close pipe: $err" if $err->errno;
+        fail $err;
+    }
     return;
 }
 

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


Reply to: