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 %maintainers = &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) })
54 if ($indexon eq "pkg") {
56 %count = countbugs(sub {my %d=@_; return $d{"pkg"}});
57 $note = "<p>Note that with multi-binary packages there may be other\n";
58 $note .= "reports filed under the different binary package names.</p>\n";
59 foreach my $pkg (keys %count) {
60 $sortkey{$pkg} = lc $pkg;
61 $htmldescrip{$pkg} = sprintf('<a href="%s">%s</a> '
62 . '(maintainer: <a href="%s">%s</a>)',
65 mainturl($maintainers{$pkg}),
66 htmlsanit($maintainers{$pkg} || "(unknown)"));
68 } elsif ($indexon eq "maint") {
70 %count = countbugs(sub {my %d=@_;
71 return emailfromrfc822($maintainers{$d{"pkg"}} || "");
73 $note = "<p>Note that maintainers may use different Maintainer fields for\n";
74 $note .= "different packages, so there may be other reports filed under\n";
75 $note .= "different addresses.</p>\n";
77 for my $x (values %maintainers) {
78 my $y = emailfromrfc822($x);
79 $email2maint{$y} = $x unless (defined $email2maint{$y});
81 foreach my $maint (keys %count) {
82 $sortkey{$maint} = lc $email2maint{$maint} || "(unknown)";
83 $htmldescrip{$maint} = sprintf('<a href="%s">%s</a>',
85 htmlsanit($email2maint{$maint}) || "(unknown)")
87 } elsif ($indexon eq "submitter") {
90 %count = countbugs(sub {my %d=@_; my $f = $d{"submitter"} || "";
91 my $em = emailfromrfc822($f);
92 $fullname{$em} = $f if (!defined $fullname{$em});
95 foreach my $sub (keys %count) {
96 $sortkey{$sub} = lc $fullname{$sub};
97 $htmldescrip{$sub} = sprintf('<a href="%s">%s</a>',
99 htmlsanit($fullname{$sub}));
101 $note = "<p>Note that people may use different email accounts for\n";
102 $note .= "different bugs, so there may be other reports filed under\n";
103 $note .= "different addresses.</p>\n";
106 my $result = "<ul>\n";
107 foreach my $x (sort { $sortkey{$a} cmp $sortkey{$b} } keys %count) {
108 $result .= "<li>" . $htmldescrip{$x} . " has $count{$x} bugs</li>\n";
110 $result .= "</ul>\n";
112 print "Content-Type: text/html\n\n";
114 print "<HTML><HEAD><TITLE>\n" .
115 "$debbugs::gProject $Archived $debbugs::gBug reports by $tag\n" .
116 "</TITLE></HEAD>\n" .
117 '<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">' .
119 print "<H1>" . "$debbugs::gProject $Archived $debbugs::gBug report logs by $tag" .
128 print "</body></html>\n";