tag 661799 patch
thanks

On Sun, Mar 11, 2012 at 08:41:17PM +0100, gregor herrmann wrote:
> On Sun, 11 Mar 2012 11:19:11 +0100, Salvatore Bonaccorso wrote:
> 
> > > I can reproduce the error, both with the version from the archive and
> > > with the package in git (funnily the first error is different in
> > > both, and also differs from your log).
> > I can confirm now too. It succeeded for me every time in a unstable
> > chroot (sbuild) within a squeeze host. But I can reproduce the build
> > failure under 'plain' unstable.
> 
> Now that's funny - the "host" shouldn't have an influece ...
> 
> And now I built it (from git) on a fast amd64 machine (so far I tried
> only old i386 boxen) -- and now it builds - ?!

I can reproduce it easily by putting some load on the build host
during the test suite. Just a "find /" in another window triggers
it for me.

The problem is in parsing the output of the 'cvs' command, which
sometimes comes in chunks of incomplete lines.

The IPC::Run based loop in Cvs::Command::Base almost handles those,
but breaks when there's a linefeed in the expected regexp, for instance
qr/File: (.*)\s+Status: (.*)\n$/ in Cvs::Command::Status.

Patch attached, this fixes it for me.

BTW, I wonder why is the test suite run under fakeroot (in the 'install'
target).
-- 
Niko Tyni   nt...@debian.org
>From ef84257ce9b0e17eddea6031112a563fb321be65 Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Tue, 27 Mar 2012 22:00:34 +0300
Subject: [PATCH] Properly handle incomplete lines when looking for a linefeed

The test suite occasionally fails on loaded hosts when the output from
the 'cvs' command comes in incomplete lines and the analyzer is looking
for a linefeed.

The fix is not to throw lone linefeeds away when an unmatched line is
being analyzed.
---
 lib/Cvs/Command/Base.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Cvs/Command/Base.pm b/lib/Cvs/Command/Base.pm
index 73b06c8..9f6d64f 100644
--- a/lib/Cvs/Command/Base.pm
+++ b/lib/Cvs/Command/Base.pm
@@ -162,7 +162,7 @@ sub run
             }
 
             # don't analyse empty lines, but $line have to be set
-            next if $line =~ /^\n*$/;
+            next if $line =~ /^\n*$/ and !defined $last;
 
             # Analysing the line: if a context is return, we replace
             # the current one with it to handling context
-- 
1.7.9.1

Reply via email to