2 # vim: ts=4 sw=4 nowrap
4 # Generate a report of the release-critical bugs for packages
10 $Version = "BugReport 1.4\nCopyright (C) 1998-2002 Wichert Akkerman <wakkerma\@debian.org>\n";
12 $statusfile = "status";
13 $commentsfile = "comments";
14 $NMUfile = "/debian/home/doogie/public_html/incoming/bugs_closed";
15 $NMUfile = "/debian/home/doogie/chgscan/db/bugs_closed"; # Changed as of request by dark -Joey, 99/11/22
16 $NMUfile = "http://auric.debian.org/~doogie/incoming/bugs_closed"; # Changed as of request by dark -Joey, 99/11/22
26 $0 [-V] [-h] [-H] [-l] -[s] [-d distrib] [-S file] [-C file]
29 -h show some (hopefully) helpful information
30 -H produce HTML output
31 -l list all release-critical bugs
32 -s list bug statistics
33 -d only list these distributions (comma-separated)
34 -S use different statusfile
35 -C use different commentsfile
40 sub PrintPackageHeader() {
41 local($p) = shift; # Package to print
42 local ($name, $email); # Name & email of maintainer
45 print "<div class=\"package\"><pre>";
46 print "<a name=\"$p\"><strong>Package:</strong></a> " . &wwwname($p);
47 print " ($section{$p}).\n";
48 print "<strong>Maintainer:</strong> ";
49 if (defined($maintainer{$p})) {
51 ($name,$email) = m/(.*) <([^>]*)>/;
52 print "$name <<a href=\"http://bugs.debian.org/$email\">$email</A>>\n";
57 print "\nPackage: $p ($section{$p})\n";
58 print "Maintainer: " . (defined($maintainer{$p}) ? $maintainer{$p} : "unknown") . "\n";
62 sub PrintPackageFooter() {
63 local($p) = shift; # Package to print
66 print "</pre></div>\n";
71 local ($p); # Index variable
72 local ($nr); # Current bugnumber
73 local ($sect); # BTS-subsection for bugnumber
74 local ($header); # Flag if packagename has already been printed
75 local ($fontset); # Did we change the font?
77 for $p (sort {$a cmp $b} keys %packagelist) {
78 next if (defined $exclude{$p});
81 if (defined $comments{$p}) {
82 if ($html && defined($comments{$p})) {
83 if ($comments{$p} =~ m/^\[REMOVE\]/) {
85 print "<span style=\"color: red\">";
89 &PrintPackageHeader($p);
92 for $nr (sort split(/ /, $packagelist{$p})) {
93 next if (defined $exclude{$nr});
96 &PrintPackageHeader($p);
101 if ($bugs{$nr} =~ m/^\[[^]]*I/ or
102 $bugs{$nr} =~ m/ \[[^]]*X/ or
103 ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/)) {
107 if ($bugs{$nr} =~ m/ \[[^]]*X/) {
108 print '<span style="color: #808080">';
109 } elsif ($bugs{$nr} =~ m/^\[[^]]*P/) {
110 print '<span style="color: #f040d0">';
111 } elsif ($bugs{$nr} =~ m/^\[[^]]*\+/) {
112 print '<span style="color: #00aa00">';
113 } elsif ($bugs{$nr} =~ m/^\[[^]]*H/) {
114 print '<span style="color: #ffaa30">';
116 print "<strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
117 print "<em class=\"worry\">" if $worry;
118 ($sect=$nr) =~ s/([0-9]{2}).*/$1/;
119 print "<A NAME=\"$nr\"></A> " . &wwwnumber($nr) . ' ' .
120 htmlsanit($bugs{$nr}) . "\n";
121 print "</em>" if $worry;
122 print "</strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
124 printf(" %-6d %s\n", $nr, $bugs{$nr});
126 print $comments{$nr} if (defined($comments{$nr}));
127 print "[FIX] Fixed by package " . $NMU{$nr, "source"} . ", version " . $NMU{$nr, "version"} . " in Incoming\n" if (defined $NMU{$nr});
128 print "</span>" if ($html && ($bugs{$nr} =~ m/^\[[^]]*[H+P]/ ||
129 $bugs{$nr} =~ m/ \[[^]]*X/));
131 print "</span>" if ($fontset);
133 &PrintPackageFooter($p);
139 sub MakeStatistics() {
140 local($bugcount); # Total number of bugs so far
141 local($count); # Number of bugs for this package
142 local($remtotal); # Total number of bugs for packages marked REMOVE
143 local($patchtotal); # Total number of bugs marked patch
144 local($pendingtotal); # Total number of bugs marked pending
145 local($ignoretotal); # Total number of bugs marked ignore
146 local($nottestingtotal); # Total number of bugs on packages not in testing
147 local($worrytotal); # Total number of bugs we're actually worried about
148 local($p); # Index variable
149 local(%list); # List of bugnumber associated with package
152 for $p (sort keys %packagelist) {
153 next if (defined $exclude{$p});
155 for $nr (split(/ /, $packagelist{$p})) {
156 $pendingtotal++ if ($bugs{$nr} =~ m/^\[[^]]*P/);
157 $patchtotal++ if ($bugs{$nr} =~ m/^\[[^]]*\+/);
158 $ignoretotal++ if ($bugs{$nr} =~ m/^\[[^]]*I/);
159 $nottestingtotal++ if ($bugs{$nr} =~ m/ \[[^]]*X/);
160 $worrytotal++ unless (
161 $bugs{$nr} =~ m/^\[[^]]*I/ or
162 $bugs{$nr} =~ m/ \[[^]]*X/ or
163 ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/));
165 if (not defined($exclude{$nr})) {
170 $remtotal+=$count if (defined($comments{$p}) && $comments{$p} =~ m/^\[REMOVE\]/);
174 print "<strong>Total number of release-critical bugs:</strong> $bugcount<BR>\n";
175 printf("<strong>Number that will disappear after removing packages marked [REMOVE]:</strong> %d<BR>\n", $remtotal);
176 printf("<strong>Number that have a patch:</strong> %d<BR>\n", $patchtotal);
177 printf("<strong>Number that have a fix prepared and waiting to upload:</strong> %d<BR>\n", $pendingtotal);
178 printf("<strong>Number that are being ignored:</strong> %d<BR>\n", $ignoretotal);
179 printf("<strong>Number on packages not in testing:</strong> %d<BR>\n", $nottestingtotal);
180 printf("<strong>Number concerning the next release (excluding ignored and not-in-testing):</strong> %d<P>\n", $worrytotal);
182 print "Total number of release-critical bugs: $bugcount\n";
183 printf("Number that will disappear after removing packages marked [REMOVE]: %d\n", $remtotal);
184 printf("Number that have a patch: %d\n", $patchtotal);
185 printf("Number that have a fix prepared and waiting to upload: %d\n", $pendingtotal);
186 printf("Number that are being ignored: %d\n", $ignoretotal);
187 printf("Number on packages not in testing: %d\n", $nottestingtotal);
188 printf("Number concerning the next release (excluding ignored and not-in-testing): %d\n", $worrytotal);
193 sub FilterPackages() {
194 local($filter) = shift; # Distribution we want to keep
196 for $p (sort keys %packagelist) {
197 delete $packagelist{$p} unless ($section{$p} =~ m/^$filter/);
201 getopts('VhHlsd:S:C:');
202 ShowUsage if ($opt_h);
203 ShowVersion if ($opt_V);
204 $statusfile=$opt_S if ($opt_S);
205 $commentsfile=$opt_C if ($opt_C);
208 &readstatus($statusfile);
209 &readcomments($commentsfile);
210 &readNMUstatus($NMUfile);
212 &FilterPackages($opt_d) if ($opt_d);
214 MakeStatistics if ($opt_s);