Source: buildd
Severity: normal

On my local setup of buildd/sbuild/wanna-build for whatever reason the pipe that
buildd uses to talk to wanna-build produces some debugging output. These are
lines such as

 D: Setting Session Purged=0
 D: Setting Log Stream=IO::File=GLOB(0x2293200)
 D: Setting Host=Sbuild::ChrootRoot=HASH(0x22831f8)
 D: Setting SETUP=1
 D2: Pipe (PID 2694, GLOB(0x22935c0)) created for: ssh -l buildd 127.0.0.1 
wanna-build --arch=amd64 --user=wbadm --api 1 --dist=sid test1_1.0-2
 Oct 13 08:52:25 buildd[2666]: D2: Environment filter: Deleted HOME
 Oct 13 08:52:25 buildd[2666]: D2: Environment filter: Deleted SSH_CLIENT
 Oct 13 08:52:25 buildd[2666]: D2: Environment filter: Deleted LANGUAGE

The code that buildd was using to parse its output was not ignoring these lines,
and would try to use them as actual wanna-build output, which clearly would 
fail.
This patch skips those lines.

>From 3cf06a2ade8de030a80162eef3dca991f892ebaf Mon Sep 17 00:00:00 2001
From: Dima Kogan <d...@secretsauce.net>
Date: Mon, 13 Oct 2014 10:35:28 -0700
Subject: [PATCH] buildd no longer parses wanna-build debug lines as real
 output

On my local setup of buildd/sbuild/wanna-build for whatever reason the pipe that
buildd uses to talk to wanna-build produces some debugging output. These are
lines such as

 D: Setting Session Purged=0
 D: Setting Log Stream=IO::File=GLOB(0x2293200)
 D: Setting Host=Sbuild::ChrootRoot=HASH(0x22831f8)
 D: Setting SETUP=1
 D2: Pipe (PID 2694, GLOB(0x22935c0)) created for: ssh -l buildd 127.0.0.1 wanna-build --arch=amd64 --user=wbadm --api 1 --dist=sid test1_1.0-2
 Oct 13 08:52:25 buildd[2666]: D2: Environment filter: Deleted HOME
 Oct 13 08:52:25 buildd[2666]: D2: Environment filter: Deleted SSH_CLIENT
 Oct 13 08:52:25 buildd[2666]: D2: Environment filter: Deleted LANGUAGE

The code that buildd was using to parse its output was not ignoring these lines,
and would try to use them as actual wanna-build output, which clearly would
fail. This patch skips those lines.
---
 lib/Buildd/Daemon.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/Buildd/Daemon.pm b/lib/Buildd/Daemon.pm
index e9cb1d7..db0d8e8 100644
--- a/lib/Buildd/Daemon.pm
+++ b/lib/Buildd/Daemon.pm
@@ -156,6 +156,9 @@ sub get_next_WANNABUILD {
 
 	    my($pkg_ver, $total, $nonex, $lowprio_pkg_ver);
 	    while( <$pipe> ) {
+		# Skip debugging lines
+		next if /^D[0-9]*:/;
+
 		my $socket = $dist_config->get('WANNA_BUILD_SSH_SOCKET');
 		if ($socket &&
 		    (/^Couldn't connect to $socket: Connection refused[\r]?$/ ||
-- 
2.0.0

Reply via email to