From 8b78b8bdb4e58e7b2fad9b1ce6a73082adfb4bc9 Mon Sep 17 00:00:00 2001 From: ajt <> Date: Sun, 1 Oct 2000 23:57:17 -0800 Subject: [PATCH] [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 --- cgi/common.pl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) 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 -- 2.39.5