[buildd-tools-devel] Bug#567821: sbuild: Fix reading pipe

Samuel Thibault sthibault at debian.org
Sun Jan 31 16:29:27 UTC 2010


Package: sbuild
Version: 0.59.0-1
Severity: normal
Tags: patch

Hello,

On hurd-i386 daemons, we get partial log messages in mails because the
perl scripts don't use a loop around reading from pipes. The attached
patch fixes it.

Samuel

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages sbuild depends on:
ii  adduser                       3.112      add and remove users and groups
ii  libsbuild-perl                0.59.0-1   Tool for building Debian binary pa
ii  perl                          5.10.1-9   Larry Wall's Practical Extraction 
ii  perl-modules                  5.10.1-9   Core Perl modules

Versions of packages sbuild recommends:
ii  debootstrap                   1.0.20     Bootstrap a basic Debian system
ii  fakeroot                      1.14.4-1   Gives a fake root environment

Versions of packages sbuild suggests:
ii  deborphan                     1.7.28     program that can find unused packa
ii  wget                          1.12-1.1   retrieves files from the web

-- no debconf information

-- 
Samuel Thibault <samuel.thibault at fnac.net>
il y a 10 cat�gories de personnes dans le monde : ceux qui comprennent le
binaire, et ceux qui ne le comprennent pas
-------------- next part --------------
diff --git a/lib/Buildd/Daemon.pm b/lib/Buildd/Daemon.pm
index a8e38aa..508d006 100644
--- a/lib/Buildd/Daemon.pm
+++ b/lib/Buildd/Daemon.pm
@@ -561,7 +561,10 @@ sub handle_prevfailed {
 	return;
     }
 
-    $fail_msg = <$pipe>;
+    $fail_msg = "";
+    while (<$pipe>) {
+      $fail_msg .= $_;
+    }
 
     close($pipe);
     if ($?) {
@@ -629,7 +632,10 @@ retry:
 	return;
     }
 
-    my $msg = <$pipe>;
+    my $msg = "";
+    while (<$pipe>) {
+      $msg .= $_;
+    }
 
     close($pipe);
 


More information about the Buildd-tools-devel mailing list