]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2000-10-12 04:07:48 by ajt]
authorajt <>
Thu, 12 Oct 2000 11:07:48 +0000 (03:07 -0800)
committerajt <>
Thu, 12 Oct 2000 11:07:48 +0000 (03:07 -0800)
Make pkgreport support include=tag1,tag2 and exclude=tag3,tag4,tag5
If an include is given only bugs with at least one of the given
  tags will be displayed; bugs with any of the tags listed for exclude
  won't be displayed no matter what.

cgi/common.pl
cgi/pkgreport.cgi

index fc98cb52b3ec6f0fa94e2378ee776bea50616e37..43eafae300f5aa543d63d4162b3df3a0a6ea2f73 100644 (file)
@@ -2,11 +2,15 @@
 
 my $common_archive = 0;
 my $common_repeatmerged = 1;
+my %common_include = ();
+my %common_exclude = ();
 
 sub set_option {
     my ($opt, $val) = @_;
     if ($opt eq "archive") { $common_archive = $val; }
     if ($opt eq "repeatmerged") { $common_repeatmerged = $val; }
+    if ($opt eq "exclude") { %common_exclude = %{$val}; }
+    if ($opt eq "include") { %common_include = %{$val}; }
 }
 
 sub quit {
@@ -174,13 +178,27 @@ sub htmlizebugs {
        my %status = getbugstatus($bug);
         next unless %status;
        my @merged = sort {$a<=>$b} ($bug, split(/ /, $status{mergedwith}));
-       if ($common_repeatmerged || $bug == $merged[0]) {
-           $section{$status{pending} . "_" . $status{severity}} .=
-               sprintf "<li><a href=\"%s\">#%d: %s</a>\n<br>",
-                   bugurl($bug), $bug, htmlsanit($status{subject});
-           $section{$status{pending} . "_" . $status{severity}} .=
-               htmlindexentrystatus(\%status) . "\n";
+       next unless ($common_repeatmerged || $bug == $merged[0]);
+       if (%common_include) {
+           my $okay = 0;
+           foreach my $t (split /\s+/, $status{tags}) {
+               $okay = 1, last if (defined $common_include{$t});
+           }
+           next unless ($okay);
+        }
+       if (%common_exclude) {
+           my $okay = 1;
+           foreach my $t (split /\s+/, $status{tags}) {
+               $okay = 0, last if (defined $comon_exclude{$t});
+           }
+           next unless ($okay);
        }
+           
+       $section{$status{pending} . "_" . $status{severity}} .=
+           sprintf "<li><a href=\"%s\">#%d: %s</a>\n<br>",
+               bugurl($bug), $bug, htmlsanit($status{subject});
+       $section{$status{pending} . "_" . $status{severity}} .=
+           htmlindexentrystatus(\%status) . "\n";
     }
 
     my $result = "";
index b9c854b161a325f5b70bb77ceb58bb52f4e4eaa5..882b25227745e80fb155039a64374291d80adf76 100755 (executable)
@@ -51,6 +51,8 @@ if (defined ($pkg = $param{'pkg'})) {
 
 my $repeatmerged = ($param{'repeatmerged'} || "yes") eq "yes";
 my $archive = ($param{'archive'} || "no") eq "yes";
+my $include = $param{'include'} || "";
+my $exclude = $param{'exclude'} || "";
 
 my $Archived = $archive ? "Archived" : "";
 
@@ -83,6 +85,10 @@ if (defined $pkg) {
 
 set_option("repeatmerged", $repeatmerged);
 set_option("archive", $archive);
+set_option("include", { map {($_,1)} (split /[\s,]+/, $include) })
+       if ($include);
+set_option("exclude", { map {($_,1)} (split /[\s,]+/, $exclude) })
+       if ($exclude);
 
 my @bugs;
 if (defined $pkg) {