]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2003-05-25 17:19:05 by cjwatson]
authorcjwatson <>
Mon, 26 May 2003 00:19:05 +0000 (16:19 -0800)
committercjwatson <>
Mon, 26 May 2003 00:19:05 +0000 (16:19 -0800)
Tolerate gaps in realtime index files. (Stolen from master; I'm not sure
who wrote it.)

scripts/errorlib.in

index dedb68da3a02e3edf452cee7078cc44311f4fbc4..b3a7dc622ffa1360733d7bba73bcbe706c09e978 100755 (executable)
@@ -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 = <IDXDB>) {
-               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(<IDXDB>);