]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2000-10-02 00:57:17 by ajt]
authorajt <>
Mon, 2 Oct 2000 07:57:17 +0000 (23:57 -0800)
committerajt <>
Mon, 2 Oct 2000 07:57:17 +0000 (23:57 -0800)
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

index 65c8ad7a63535033c3965cc4067f6ad0cd099731..970538ae0fb2a9b0a75239faa984ab4048491e8b 100644 (file)
@@ -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