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 "\n<a name=\"$p\"><strong>Package:</strong> " . &wwwname($p);
46 print " ($section{$p}).\n";
47 print "<strong>Maintainer:</strong> ";
48 if (defined($maintainer{$p})) {
50 ($name,$email) = m/(.*) <([^>]*)>/;
51 print "$name <<a href=\"http://bugs.debian.org/$email\">$email</A>>\n";
56 print "\nPackage: $p ($section{$p})\n";
57 print "Maintainer: " . (defined($maintainer{$p}) ? $maintainer{$p} : "unknown") . "\n";
63 local ($p); # Index variable
64 local ($nr); # Current bugnumber
65 local ($sect); # BTS-subsection for bugnumber
66 local ($header); # Flag if packagename has already been printed
67 local ($fontset); # Did we change the font?
69 print "<pre>\n" if ($html);
70 for $p (sort {$a cmp $b} keys %packagelist) {
71 next if (defined $exclude{$p});
74 if (defined $comments{$p}) {
75 if ($html && defined($comments{$p})) {
76 if ($comments{$p} =~ m/^\[REMOVE\]/) {
78 print "<font color=red>";
82 &PrintPackageHeader($p);
85 for $nr (sort split(/ /, $packagelist{$p})) {
86 next if (defined $exclude{$nr});
89 &PrintPackageHeader($p);
93 if ($bugs{$nr} =~ m/ \[[^]]*X/) {
94 print '<font color="#808080">';
95 } elsif ($bugs{$nr} =~ m/^\[[^]]*P/) {
96 print '<font color="#f040d0">';
97 } elsif ($bugs{$nr} =~ m/^\[[^]]*\+/) {
98 print '<font color="#00aa00">';
99 } elsif ($bugs{$nr} =~ m/^\[[^]]*H/) {
100 print '<font color="#ffaa30">';
102 print "<strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
103 ($sect=$nr) =~ s/([0-9]{2}).*/$1/;
104 print "<A NAME=\"$nr\"> " . &wwwnumber($nr) . ' ' .
105 htmlsanit($bugs{$nr}) . "\n";
106 print "</strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
108 printf(" %-6d %s\n", $nr, $bugs{$nr});
110 print $comments{$nr} if (defined($comments{$nr}));
111 print "[FIX] Fixed by package " . $NMU{$nr, "source"} . ", version " . $NMU{$nr, "version"} . " in Incoming\n" if (defined $NMU{$nr});
112 print "</font>" if ($html && ($bugs{$nr} =~ m/^\[[^]]*[H+P]/ ||
113 $bugs{$nr} =~ m/ \[[^]]*X/));
115 print "</font>" if ($fontset);
117 print "</pre>\n" if ($html);
121 sub MakeStatistics() {
122 local($bugcount); # Total number of bugs so far
123 local($count); # Number of bugs for this package
124 local($remtotal); # Total number of bugs for packages marked REMOVE
125 local($patchtotal); # Total number of bugs marked patch
126 local($pendingtotal); # Total number of bugs marked pending
127 local($ignoretotal); # Total number of bugs marked ignore
128 local($nottestingtotal); # Total number of bugs on packages not in testing
129 local($worrytotal); # Total number of bugs we're actually worried about
130 local($p); # Index variable
131 local(%list); # List of bugnumber associated with package
134 for $p (sort keys %packagelist) {
135 next if (defined $exclude{$p});
137 for $nr (split(/ /, $packagelist{$p})) {
138 $pendingtotal++ if ($bugs{$nr} =~ m/^\[[^]]*P/);
139 $patchtotal++ if ($bugs{$nr} =~ m/^\[[^]]*\+/);
140 $ignoretotal++ if ($bugs{$nr} =~ m/^\[[^]]*I/);
141 $nottestingtotal++ if ($bugs{$nr} =~ m/ \[[^]]*X/);
142 $worrytotal++ unless (
143 $bugs{$nr} =~ m/^\[[^]]*I/ or
144 $bugs{$nr} =~ m/ \[[^]]*X/ or
145 ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/));
147 if (not defined($exclude{$nr})) {
152 $remtotal+=$count if (defined($comments{$p}) && $comments{$p} =~ m/^\[REMOVE\]/);
156 print "<strong>Total number of release-critical bugs:</strong> $bugcount<BR>\n";
157 printf("<strong>Number that will disappear after removing packages marked [REMOVE]:</strong> %d<BR>\n", $remtotal);
158 printf("<strong>Number that have a patch:</strong> %d<BR>\n", $patchtotal);
159 printf("<strong>Number that have a fix prepared and waiting to upload:</strong> %d<BR>\n", $pendingtotal);
160 printf("<strong>Number that are being ignored:</strong> %d<BR>\n", $ignoretotal);
161 printf("<strong>Number on packages not in testing:</strong> %d<BR>\n", $nottestingtotal);
162 printf("<strong>Number concerning the next release (excluding ignored and not-in-testing):</strong> %d<P>\n", $worrytotal);
164 print "Total number of release-critical bugs: $bugcount\n";
165 printf("Number that will disappear after removing packages marked [REMOVE]: %d\n", $remtotal);
166 printf("Number that have a patch: %d\n", $patchtotal);
167 printf("Number that have a fix prepared and waiting to upload: %d\n", $pendingtotal);
168 printf("Number that are being ignored: %d\n", $ignoretotal);
169 printf("Number on packages not in testing: %d\n", $nottestingtotal);
170 printf("Number concerning the next release (excluding ignored and not-in-testing): %d\n", $worrytotal);
175 sub FilterPackages() {
176 local($filter) = shift; # Distribution we want to keep
178 for $p (sort keys %packagelist) {
179 delete $packagelist{$p} unless ($section{$p} =~ m/^$filter/);
183 getopts('VhHlsd:S:C:');
184 ShowUsage if ($opt_h);
185 ShowVersion if ($opt_V);
186 $statusfile=$opt_S if ($opt_S);
187 $commentsfile=$opt_C if ($opt_C);
190 &readstatus($statusfile);
191 &readcomments($commentsfile);
192 &readNMUstatus($NMUfile);
194 &FilterPackages($opt_d) if ($opt_d);
196 MakeStatistics if ($opt_s);