6 use POSIX qw(strftime tzset nice);
8 #require '/usr/lib/debbugs/errorlib';
9 require '/usr/lib/debbugs/common.pl';
10 #require '/debian/home/ajt/newajbug/common.pl';
12 require '/etc/debbugs/config';
13 require '/etc/debbugs/text';
17 my %param = readparse();
19 my $indexon = $param{'indexon'} || 'pkg';
20 if ($indexon !~ m/^(pkg|maint|submitter)/) {
21 quit("You have to choose something to index on");
24 my $repeatmerged = ($param{'repeatmerged'} || "yes") eq "yes";
25 my $archive = ($param{'archive'} || "no") eq "yes";
26 #my $include = $param{'include'} || "";
27 #my $exclude = $param{'exclude'} || "";
29 my $Archived = $archive ? "Archived" : "";
31 my %maintainer = &getmaintainers();
37 my $dtime = strftime "%a, %e %b %Y %T UTC", localtime;
38 my $tail_html = $debbugs::gHTMLTail;
39 $tail_html = $debbugs::gHTMLTail;
40 $tail_html =~ s/SUBSTITUTE_DTIME/$dtime/;
42 set_option("repeatmerged", $repeatmerged);
43 set_option("archive", $archive);
44 set_option("include", { map {($_,1)} (split /[\s,]+/, $include) })
46 set_option("exclude", { map {($_,1)} (split /[\s,]+/, $exclude) })
52 if ($indexon eq "pkg") {
54 %count = countbugs(sub {my %d=@_; return $d{"pkg"}});
55 $note = "<p>Note that with multi-binary packages there may be other\n";
56 $note .= "reports filed under the different binary package names.</p>\n";
57 } elsif ($indexon eq "maint") {
59 %@count = countbugs(sub {my %d=@_; my $me;
60 $me = $maintainers{$d{"pkg"}} || "";
61 $me =~ s/\s*\(.*\)\s*//;
62 $me = $1 if ($me =~ m/<(.*)>/);
65 $note = "<p>Note that maintainers may use different Maintainer fields for\n";
66 $note .= "different packages, so there may be other reports filed under\n";
67 $note .= "different addresses.</p>\n";
68 } elsif ($indexon eq "submitter") {
70 %count = countbugs(sub {my %d=@_; my $se;
71 ($se = $d{"submitter"} || "") =~ s/\s*\(.*\)\s*//;
72 if ($se =~ m/<(.*)>/) { $me = $1 }
75 $note = "<p>Note that people may use different email accounts for\n";
76 $note .= "different bugs, so there may be other reports filed under\n";
77 $note .= "different addresses.</p>\n";
80 my $result = "<ul>\n";
81 foreach my $x (sort keys %count) {
82 $result .= sprintf('<li><a href="pkgreport.cgi?%s=%s">%s</a> %d bugs</li>\n',
83 $indexon, $x, $x, $count{$x});
87 print "Content-Type: text/html\n\n";
89 print "<HTML><HEAD><TITLE>\n" .
90 "$debbugs::gProject $Archived $debbugs::gBug reports by $tag\n" .
92 '<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">' .
94 print "<H1>" . "$debbugs::gProject $Archived $debbugs::gBug report logs: $tag" .
103 print "</body></html>\n";