From d23eb0221bd8100aab0bc6bc0a3b8f55a4354c5b Mon Sep 17 00:00:00 2001
From: doogie <>
Date: Sat, 17 Nov 2001 06:45:41 -0800
Subject: [PATCH] [project @ 2001-11-17 06:45:41 by doogie] Add support for
reversing the order that bugs are displayed(this does not affect severity or
status ordering).
---
cgi/common.pl | 9 ++++++++-
cgi/pkgreport.cgi | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/cgi/common.pl b/cgi/common.pl
index 8c52ef7..ccced58 100644
--- a/cgi/common.pl
+++ b/cgi/common.pl
@@ -8,6 +8,7 @@ my $common_repeatmerged = 1;
my %common_include = ();
my %common_exclude = ();
my $common_raw_sort = 0;
+my $common_bug_reverse = 0;
my $debug = 0;
@@ -18,6 +19,7 @@ sub set_option {
if ($opt eq "exclude") { %common_exclude = %{$val}; }
if ($opt eq "include") { %common_include = %{$val}; }
if ($opt eq "raw") { $common_raw_sort = $val; }
+ if ($opt eq "bug-rev") { $common_bug_reverse = $val; }
}
sub readparse {
@@ -243,7 +245,12 @@ sub htmlizebugs {
return "
No reports found!
\n";
}
- foreach my $bug (sort {$a<=>$b} @bugs) {
+ if ( $common_bug_reverse ) {
+ @bugs = sort {$b<=>$a} @bugs;
+ } else {
+ @bugs = sort {$a<=>$b} @bugs;
+ }
+ foreach my $bug (@bugs) {
my %status = %{getbugstatus($bug)};
next unless %status;
my @merged = sort {$a<=>$b} ($bug, split(/ /, $status{mergedwith}));
diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi
index 103edd3..5690eb3 100755
--- a/cgi/pkgreport.cgi
+++ b/cgi/pkgreport.cgi
@@ -33,6 +33,7 @@ my $archive = ($param{'archive'} || "no") eq "yes";
my $include = $param{'include'} || "";
my $exclude = $param{'exclude'} || "";
my $raw_sort = ($param{'raw'} || "no") eq "yes";
+my $bug_rev = ($param{'bug-rev'} || "no") eq "yes";
my $Archived = $archive ? " Archived" : "";
@@ -56,6 +57,7 @@ set_option("include", { map {if (m/^(.*):(.*)$/) { ($1,$2) } else { ($_,1) }} (s
set_option("exclude", { map {if (m/^(.*):(.*)$/) { ($1,$2) } else { ($_,1) }} (split /[\s,]+/, $exclude) })
if ($exclude);
set_option("raw", $raw_sort);
+set_option("bug-rev", $bug_rev);
my $tag;
my @bugs;
--
2.39.2