From: ajt <> Date: Mon, 2 Oct 2000 07:57:17 +0000 (-0800) Subject: [project @ 2000-10-02 00:57:17 by ajt] X-Git-Tag: release/2.6.0~1268 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8b78b8bdb4e58e7b2fad9b1ce6a73082adfb4bc9;p=debbugs.git [project @ 2000-10-02 00:57:17 by ajt] Always sort pkgindex bugs by bug number (this wasn't happening in archived reports, i think) Always look in both the open and archived database for specific bugs --- diff --git a/cgi/common.pl b/cgi/common.pl index 65c8ad7a..970538ae 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -237,7 +237,7 @@ sub getbugs { } } close I; - return @result; + return sort {$a <=> $b} @result; } sub pkgbugsindex { @@ -291,11 +291,9 @@ sub getbugstatus { my %status; - if ( $common_archive ) { + unless (open(S,"$gSpoolDir/db/$bugnum.status")) { my $archdir = sprintf "%02d", $bugnum % 100; open(S,"$gSpoolDir/archive/$archdir/$bugnum.status" ) or return (); - } else { - open(S,"$gSpoolDir/db/$bugnum.status") or return (); } my @lines = qw(originator date subject msgid package keywords done forwarded mergedwith severity); @@ -319,12 +317,16 @@ sub getbugstatus { sub buglog { my $bugnum = shift; - if ( $common_archive ) { - my $archdir = sprintf "%02d", $bugnum % 100; - return "$gSpoolDir/archive/$archdir/$bugnum.log"; - } else { - return "$gSpoolDir/db/$bugnum.log"; - } + my $res; + + $res = "$gSpoolDir/db/$bugnum.log"; + return $res if ( -e $res ); + + my $archdir = sprintf "%02d", $bugnum % 100; + $res = "$gSpoolDir/archive/$archdir/$bugnum.log"; + return $res if ( -e $res ); + + return ""; } 1