[devscripts] 04/05: chdist: Slurp all output of child processes

James McCoy jamessan at debian.org
Wed May 28 04:20:05 UTC 2014


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

jamessan pushed a commit to branch master
in repository devscripts.

commit 7a30b860a5147d47b2033c710dd9c9a74ccb12d9
Author: James McCoy <jamessan at debian.org>
Date:   Tue May 27 23:18:27 2014 -0400

    chdist: Slurp all output of child processes
    
    Closing the read handle of a child process when there's unread output
    causes the child to exit with SIGPIPE, which bubbles up to the caller.
    
    Ensure all output is read (although discarded) and then close the handle
    to avoid unnecessary errors.
    
    Closes: #749504
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog  | 2 ++
 scripts/chdist.pl | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7fadd35..61b0a1e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,8 @@ devscripts (2.14.3) UNRELEASED; urgency=medium
     + Restore display of final file name after file is downloaded.
   * mk-origtargz: Use file's mime detection to detect zip files.  (Closes:
     #748462)
+  * chdist: Finish reading output from child processes to avoid getting a
+    SIGPIPE when closing their read handle.  (Closes: #749504)
 
   [ Christoph Berg ]
   * uscan: Fix "upsteam" typo.  (Closes: #749343)
diff --git a/scripts/chdist.pl b/scripts/chdist.pl
index f74bbc7..5c78207 100755
--- a/scripts/chdist.pl
+++ b/scripts/chdist.pl
@@ -281,6 +281,9 @@ sub bin2src
 	while (<CACHE>) {
 	    if (m/^Source: (.*)/) {
 		$src = $1;
+		# Slurp remaining output to avoid SIGPIPE
+		local $/ = undef;
+		my $junk = <CACHE>;
 		last;
 	    }
 	}
@@ -304,6 +307,9 @@ sub src2bin {
 	while (<CACHE>) {
 	    if (m/^Binary: (.*)/) {
 		print join("\n", split(/, /, $1)) . "\n";
+		# Slurp remaining output to avoid SIGPIPE
+		local $/ = undef;
+		my $junk = <CACHE>;
 		last;
 	    }
 	}

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



More information about the devscripts-devel mailing list