]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2003-08-06 23:35:55 by cjwatson]
authorcjwatson <>
Thu, 7 Aug 2003 06:35:55 +0000 (22:35 -0800)
committercjwatson <>
Thu, 7 Aug 2003 06:35:55 +0000 (22:35 -0800)
Support indexon=tag for pkgindex.cgi.

cgi/common.pl
cgi/pkgindex.cgi

index 9986d2a69dd64d08bb90afcfdf5bb215fa3fe4ae..5886cf2c4069b2ec65ec9e42715232ed1ac062c5 100644 (file)
@@ -287,6 +287,14 @@ sub srcurl {
     return urlsanit("pkgreport.cgi" . "?" . "$params");
 }
 
+sub tagurl {
+    my $ref = shift;
+    my $params = "tag=$ref";
+    $params .= "&archive=yes" if ($common_archive);
+    $params .= "&repeatmerged=no" unless ($common_repeatmerged);
+    return urlsanit("pkgreport.cgi" . "?" . "$params");
+}
+
 sub urlsanit {
     my $url = shift;
     $url =~ s/%/%25/g;
index a2c73e501cd3a440404f4de4c076ca671338aef1..029ecd872b808e30d6f3d271c1edeef3761b0f8d 100755 (executable)
@@ -16,7 +16,7 @@ nice(5);
 my %param = readparse();
 
 my $indexon = $param{'indexon'} || 'pkg';
-if ($indexon !~ m/^(pkg|src|maint|submitter)$/) {
+if ($indexon !~ m/^(pkg|src|maint|submitter|tag)$/) {
     quitcgi("You have to choose something to index on");
 }
 
@@ -124,6 +124,16 @@ if ($indexon eq "pkg") {
   $note = "<p>Note that people may use different email accounts for\n";
   $note .= "different bugs, so there may be other reports filed under\n";
   $note .= "different addresses.</p>\n";
+} elsif ($indexon eq "tag") {
+  $tag = "tag";
+  %count = countbugs(sub {my %d=@_; return split ' ', $d{tags}; });
+  $note = "";
+  foreach my $keyword (keys %count) {
+    $sortkey{$keyword} = lc $keyword;
+    $htmldescrip{$keyword} = sprintf('<a href="%s">%s</a>',
+                               tagurl($keyword),
+                               htmlsanit($keyword));
+  }
 }
 
 my $result = "<ul>\n";