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 -t show bugs relevant for testing only
34 -d only list these distributions (comma-separated)
35 -S use different statusfile
36 -C use different commentsfile
41 sub PrintPackageHeader() {
42 local($p) = shift; # Package to print
43 local ($name, $email); # Name & email of maintainer
46 print "<div class=\"package\"><pre>";
47 print "<a name=\"$p\"><strong>Package:</strong></a> " . &wwwname($p);
48 print " ($section{$p}).\n";
49 print "<strong>Maintainer:</strong> ";
50 if (defined($maintainer{$p})) {
52 ($name,$email) = m/(.*) <([^>]*)>/;
53 print "$name <<a href=\"http://bugs.debian.org/$email\">$email</A>>\n";
58 print "\nPackage: $p ($section{$p})\n";
59 print "Maintainer: " . (defined($maintainer{$p}) ? $maintainer{$p} : "unknown") . "\n";
63 sub PrintPackageFooter() {
64 local($p) = shift; # Package to print
67 print "</pre></div>\n";
72 local ($p); # Index variable
73 local ($nr); # Current bugnumber
74 local ($sect); # BTS-subsection for bugnumber
75 local ($header); # Flag if packagename has already been printed
76 local ($fontset); # Did we change the font?
78 for $p (sort {$a cmp $b} keys %packagelist) {
79 next if (defined $exclude{$p});
82 if (defined $comments{$p}) {
83 if ($html && defined($comments{$p})) {
84 if ($comments{$p} =~ m/^\[REMOVE\]/) {
86 print "<span style=\"color: red\">";
90 &PrintPackageHeader($p);
93 for $nr (sort split(/ /, $packagelist{$p})) {
94 next if (defined $exclude{$nr});
97 &PrintPackageHeader($p);
102 if ($bugs{$nr} =~ m/^\[[^]]*I/ or
103 $bugs{$nr} =~ m/ \[[^]]*X/ or
104 ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/)) {
108 if ($bugs{$nr} =~ m/ \[[^]]*X/) {
109 print '<span style="color: #808080">';
110 } elsif ($bugs{$nr} =~ m/^\[[^]]*P/) {
111 print '<span style="color: #f040d0">';
112 } elsif ($bugs{$nr} =~ m/^\[[^]]*\+/) {
113 print '<span style="color: #00aa00">';
114 } elsif ($bugs{$nr} =~ m/^\[[^]]*H/) {
115 print '<span style="color: #ffaa30">';
117 print "<strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
118 print "<em class=\"worry\">" if $worry;
119 ($sect=$nr) =~ s/([0-9]{2}).*/$1/;
120 print "<A NAME=\"$nr\"></A> " . &wwwnumber($nr) . ' ' .
121 htmlsanit($bugs{$nr}) . "\n";
122 print "</em>" if $worry;
123 print "</strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
125 printf(" %-6d %s\n", $nr, $bugs{$nr});
127 print $comments{$nr} if (defined($comments{$nr}));
128 print "[FIX] Fixed by package " . $NMU{$nr, "source"} . ", version " . $NMU{$nr, "version"} . " in Incoming\n" if (defined $NMU{$nr});
129 print "</span>" if ($html && ($bugs{$nr} =~ m/^\[[^]]*[H+P]/ ||
130 $bugs{$nr} =~ m/ \[[^]]*X/));
132 print "</span>" if ($fontset);
134 &PrintPackageFooter($p);
140 sub MakeStatistics() {
141 local($bugcount); # Total number of bugs so far
142 local($count); # Number of bugs for this package
143 local($remtotal); # Total number of bugs for packages marked REMOVE
144 local($patchtotal); # Total number of bugs marked patch
145 local($pendingtotal); # Total number of bugs marked pending
146 local($ignoretotal); # Total number of bugs marked ignore
147 local($nottestingtotal); # Total number of bugs on packages not in testing
148 local($worrytotal); # Total number of bugs we're actually worried about
149 local($p); # Index variable
150 local(%list); # List of bugnumber associated with package
153 for $p (sort keys %packagelist) {
154 next if (defined $exclude{$p});
156 for $nr (split(/ /, $packagelist{$p})) {
157 $pendingtotal++ if ($bugs{$nr} =~ m/^\[[^]]*P/);
158 $patchtotal++ if ($bugs{$nr} =~ m/^\[[^]]*\+/);
159 $ignoretotal++ if ($bugs{$nr} =~ m/^\[[^]]*I/);
160 $nottestingtotal++ if ($bugs{$nr} =~ m/ \[[^]]*X/);
161 $worrytotal++ unless (
162 $bugs{$nr} =~ m/^\[[^]]*I/ or
163 $bugs{$nr} =~ m/ \[[^]]*X/ or
164 ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/));
166 if (not defined($exclude{$nr})) {
171 $remtotal+=$count if (defined($comments{$p}) && $comments{$p} =~ m/^\[REMOVE\]/);
175 print "<strong>Total number of release-critical bugs:</strong> $bugcount<BR>\n";
176 printf("<strong>Number that will disappear after removing packages marked [REMOVE]:</strong> %d<BR>\n", $remtotal);
177 printf("<strong>Number that have a patch:</strong> %d<BR>\n", $patchtotal);
178 printf("<strong>Number that have a fix prepared and waiting to upload:</strong> %d<BR>\n", $pendingtotal);
179 printf("<strong>Number that are being ignored:</strong> %d<BR>\n", $ignoretotal);
180 printf("<strong>Number on packages not in testing:</strong> %d<BR>\n", $nottestingtotal);
181 printf("<strong>Number concerning the next release (excluding ignored and not-in-testing):</strong> %d<P>\n", $worrytotal);
183 print "Total number of release-critical bugs: $bugcount\n";
184 printf("Number that will disappear after removing packages marked [REMOVE]: %d\n", $remtotal);
185 printf("Number that have a patch: %d\n", $patchtotal);
186 printf("Number that have a fix prepared and waiting to upload: %d\n", $pendingtotal);
187 printf("Number that are being ignored: %d\n", $ignoretotal);
188 printf("Number on packages not in testing: %d\n", $nottestingtotal);
189 printf("Number concerning the next release (excluding ignored and not-in-testing): %d\n", $worrytotal);
194 sub FilterPackages() {
195 local($filter) = shift; # Distribution we want to keep
197 for $p (sort keys %packagelist) {
198 delete $packagelist{$p} unless ($section{$p} =~ m/^$filter/);
203 for $p (sort keys %packagelist) {
204 $packagelist{$p} = join(' ', grep { check_worry($bugs{$_}) } split / /, $packagelist{$p});
205 delete $packagelist{$p} if ($packagelist{$p} eq '');
209 getopts('VhHlstd:S:C:');
210 ShowUsage if ($opt_h);
211 ShowVersion if ($opt_V);
212 $statusfile=$opt_S if ($opt_S);
213 $commentsfile=$opt_C if ($opt_C);
216 &readstatus($statusfile);
217 &readcomments($commentsfile);
218 &readNMUstatus($NMUfile);
220 &FilterPackages($opt_d) if ($opt_d);
221 &FilterBugs() if ($opt_t);
223 MakeStatistics if ($opt_s);