From fe24a5aedfbf07efba3c14d7451ed3f9774dde43 Mon Sep 17 00:00:00 2001 From: doogie <> Date: Sat, 17 Nov 2001 06:49:28 -0800 Subject: [PATCH] [project @ 2001-11-17 06:49:28 by doogie] Add support for inclusions/exclusions of status and severity. Also, support reverse sorting of the above. --- cgi/common.pl | 54 +++++++++++++++++++++++++++++++++++++++++++++-- cgi/pkgreport.cgi | 12 +++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/cgi/common.pl b/cgi/common.pl index ccced58..4ab70d5 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -9,6 +9,13 @@ my %common_include = (); my %common_exclude = (); my $common_raw_sort = 0; my $common_bug_reverse = 0; +my $common_pending_reverse = 0; +my $common_severity_reverse = 0; + +my @common_pending_include = (); +my @common_pending_exclude = (); +my @common_severity_include = (); +my @common_severity_exclude = (); my $debug = 0; @@ -20,6 +27,36 @@ sub set_option { if ($opt eq "include") { %common_include = %{$val}; } if ($opt eq "raw") { $common_raw_sort = $val; } if ($opt eq "bug-rev") { $common_bug_reverse = $val; } + if ($opt eq "pend-rev") { $common_pending_reverse = $val; } + if ($opt eq "sev-rev") { $common_severity_reverse = $val; } + if ($opt eq "pend-exc") { + my @vals; + @vals = ( $val ) if (ref($val) eq "" && $val ); + @vals = ( $$val ) if (ref($val) eq "SCALAR" && $$val ); + @vals = @{$val} if (ref($val) eq "ARRAY" ); + @common_pending_exclude = @vals if (@vals); + } + if ($opt eq "pend-inc") { + my @vals; + @vals = ( $val, ) if (ref($val) eq "" && $val ); + @vals = ( $$val, ) if (ref($val) eq "SCALAR" && $$val ); + @vals = @{$val} if (ref($val) eq "ARRAY" ); + @common_pending_include = @vals if (@vals); + } + if ($opt eq "sev-exc") { + my @vals; + @vals = ( $val ) if (ref($val) eq "" && $val ); + @vals = ( $$val ) if (ref($val) eq "SCALAR" && $$val ); + @vals = @{$val} if (ref($val) eq "ARRAY" ); + @common_severity_exclude = @vals if (@vals); + } + if ($opt eq "sev-inc") { + my @vals; + @vals = ( $val ) if (ref($val) eq "" && $val ); + @vals = ( $$val ) if (ref($val) eq "SCALAR" && $$val ); + @vals = @{$val} if (ref($val) eq "ARRAY" ); + @common_severity_include = @vals if (@vals); + } } sub readparse { @@ -292,8 +329,21 @@ sub htmlizebugs { if ($common_raw_sort) { $result .= "\n"; } else { - foreach my $pending (qw(pending forwarded pending-fixed fixed done)) { - foreach my $severity(@debbugs::gSeverityList) { + my @pendingList = qw(pending forwarded pending-fixed fixed done); + @pendingList = @common_pending_include if @common_pending_include; + @pendingList = reverse @pendingList if $common_pending_reverse; +#print STDERR join(",",@pendingList)."\n"; +#print STDERR join(",",@common_pending_include).":$#common_pending_include\n"; + foreach my $pending (@pendingList) { + next if grep( /^$pending$/, @common_pending_exclude); + my @severityList = @debbugs::gSeverityList; + @severityList = @common_severity_include if @common_severity_include; + @severityList = reverse @severityList if $common_severity_reverse; +#print STDERR join(",",@severityList)."\n"; + +# foreach my $severity(@debbugs::gSeverityList) { + foreach my $severity(@severityList) { + next if grep( /^$severity$/, @common_severity_exclude); $severity = $debbugs::gDefaultSeverity if ($severity eq ''); next unless defined $section{${pending} . "_" . ${severity}}; $result .= "

$debbugs::gSeverityDisplay{$severity} - $displayshowpending{$pending}

\n"; diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index 5690eb3..e52797f 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -34,6 +34,12 @@ 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 $pend_rev = ($param{'pend-rev'} || "no") eq "yes"; +my $sev_rev = ($param{'sev-rev'} || "no") eq "yes"; +my $pend_exc = $param{'&pend-exc'} || $param{'pend-exc'} || ""; +my $pend_inc = $param{'&pend-inc'} || $param{'pend-inc'} || ""; +my $sev_exc = $param{'&sev-exc'} || $param{'sev-exc'} || ""; +my $sev_inc = $param{'&sev-inc'} || $param{'sev-inc'} || ""; my $Archived = $archive ? " Archived" : ""; @@ -58,6 +64,12 @@ set_option("exclude", { map {if (m/^(.*):(.*)$/) { ($1,$2) } else { ($_,1) }} (s if ($exclude); set_option("raw", $raw_sort); set_option("bug-rev", $bug_rev); +set_option("pend-rev", $pend_rev); +set_option("sev-rev", $sev_rev); +set_option("pend-exc", $pend_exc); +set_option("pend-inc", $pend_inc); +set_option("sev-exc", $sev_exc); +set_option("sev-inc", $sev_inc); my $tag; my @bugs; -- 2.39.2