From: cjwatson <> Date: Mon, 26 May 2003 00:19:05 +0000 (-0800) Subject: [project @ 2003-05-25 17:19:05 by cjwatson] X-Git-Tag: release/2.6.0~889 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=07e96ae0e83d4cfb1dabec2df5405fd9a9df116a;p=debbugs.git [project @ 2003-05-25 17:19:05 by cjwatson] Tolerate gaps in realtime index files. (Stolen from master; I'm not sure who wrote it.) --- diff --git a/scripts/errorlib.in b/scripts/errorlib.in index dedb68da..b3a7dc62 100755 --- a/scripts/errorlib.in +++ b/scripts/errorlib.in @@ -1,5 +1,5 @@ # -*- perl -*- -# $Id: errorlib.in,v 1.23 2003/05/24 22:43:55 cjwatson Exp $ +# $Id: errorlib.in,v 1.24 2003/05/25 17:19:05 cjwatson Exp $ sub F_SETLK { 6; } sub F_WRLCK{ 1; } $flockstruct= 'sslll'; # And there ought to be something for this too. @@ -185,19 +185,25 @@ sub update_realtime { open(IDXNEW, ">$file.new"); my $line; + my @line; while($line = ) { - my @line = split /\s/, $line; - last if ($line[1] == $bug); + @line = split /\s/, $line; + last if ($line[1] >= $bug); print IDXNEW $line; + $line = ""; } if ($new eq "NOCHANGE") { - print IDXNEW $line; + print IDXNEW $line if ($line ne "" && $line[1] == $ref); } elsif ($new eq "REMOVE") { 0; } else { print IDXNEW $new; } + if ($line ne "" && $line[1] > $bug) { + print IDXNEW $line; + $line = ""; + } print IDXNEW while();