]> git.donarmstrong.com Git - bugscan.git/blobdiff - bugreport
Make an option for listing out only bugs that are applicable to testing.
[bugscan.git] / bugreport
index e06d3c989e8d3c46d37379850430cd3f0c4446c2..5749ac2ccb2d38afffca83741cab39e4ecae7b31 100755 (executable)
--- a/bugreport
+++ b/bugreport
@@ -23,13 +23,14 @@ sub ShowVersion() {
 sub ShowUsage() {
        print <<EOF;
 Usage:
-  $0 [-V] [-h] [-H] [-l] -[s] [-d distrib] [-S file] [-C file]
+  $0 [-V] [-h] [-H] [-l] [-s] [-d distrib] [-S file] [-C file]
 Options:
   -V    show version
   -h    show some (hopefully) helpful information
   -H    produce HTML output
   -l    list all release-critical bugs
   -s    list bug statistics
+  -t    show bugs relevant for testing only
   -d    only list these distributions (comma-separated)
   -S    use different statusfile
   -C    use different commentsfile
@@ -42,7 +43,8 @@ sub PrintPackageHeader() {
        local ($name, $email);  # Name & email of maintainer
 
        if ($html) {
-               print "\n<a name=\"$p\"><strong>Package:</strong> " . &wwwname($p);
+           print "<div class=\"package\"><pre>";
+               print "<a name=\"$p\"><strong>Package:</strong></a> " . &wwwname($p);
                print " ($section{$p}).\n";
                print "<strong>Maintainer:</strong> ";
                if (defined($maintainer{$p})) {
@@ -58,6 +60,13 @@ sub PrintPackageHeader() {
        }
 }
 
+sub PrintPackageFooter() {
+       local($p)       = shift;        # Package to print
+
+       if ($html) {
+               print "</pre></div>\n";
+       }
+}
 
 sub MakeBuglist() {
        local ($p);                             # Index variable
@@ -66,7 +75,6 @@ sub MakeBuglist() {
        local ($header);                # Flag if packagename has already been printed
        local ($fontset);               # Did we change the font?
 
-       print "<pre>\n" if ($html);
        for $p (sort {$a cmp $b} keys %packagelist) {
                next if (defined $exclude{$p});
                $header = 0;
@@ -75,7 +83,7 @@ sub MakeBuglist() {
                        if ($html && defined($comments{$p})) {
                                if ($comments{$p} =~ m/^\[REMOVE\]/) {
                                        $fontset=1;
-                                       print "<font color=red>";
+                                       print "<span style=\"color: red\">";
                                }
                        }
                        $header=1;
@@ -90,31 +98,42 @@ sub MakeBuglist() {
                        }
 
                        if ($html) {
+                           $worry = 1;
+                               if ($bugs{$nr} =~ m/^\[[^]]*I/ or
+                                       $bugs{$nr} =~ m/ \[[^]]*X/ or
+                                       ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/)) {
+                                       $worry = 0;
+                               }
+                       
                                if ($bugs{$nr} =~ m/ \[[^]]*X/) {
-                                       print '<font color="#808080">';
+                                       print '<span style="color: #808080">';
                                } elsif ($bugs{$nr} =~ m/^\[[^]]*P/) {
-                                       print '<font color="#f040d0">';
+                                       print '<span style="color: #f040d0">';
                                } elsif ($bugs{$nr} =~ m/^\[[^]]*\+/) {
-                                       print '<font color="#00aa00">';
+                                       print '<span style="color: #00aa00">';
                                } elsif ($bugs{$nr} =~ m/^\[[^]]*H/) {
-                                       print '<font color="#ffaa30">';
+                                       print '<span style="color: #ffaa30">';
                                }
                                print "<strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
+                               print "<em class=\"worry\">" if $worry;
                                ($sect=$nr) =~ s/([0-9]{2}).*/$1/;
-                               print "<A NAME=\"$nr\">  " . &wwwnumber($nr) . ' ' .
+                               print "<A NAME=\"$nr\"></A>  " . &wwwnumber($nr) . ' ' .
                                          htmlsanit($bugs{$nr}) . "\n";
+                               print "</em>" if $worry;
                                print "</strike>" if ($bugs{$nr} =~ m/^\[.......I\]/);
                        } else {
                                printf("  %-6d %s\n", $nr, $bugs{$nr});
                        }
                        print $comments{$nr} if (defined($comments{$nr}));
                        print "[FIX] Fixed by package " . $NMU{$nr, "source"} . ", version " . $NMU{$nr, "version"} . " in Incoming\n" if (defined $NMU{$nr});
-                       print "</font>" if ($html && ($bugs{$nr} =~ m/^\[[^]]*[H+P]/ ||
+                       print "</span>" if ($html && ($bugs{$nr} =~ m/^\[[^]]*[H+P]/ ||
                                                      $bugs{$nr} =~ m/ \[[^]]*X/));
                }
-               print "</font>" if ($fontset);
+               print "</span>" if ($fontset);
+               if ($header) {
+                       &PrintPackageFooter($p);
+               }
        }
-       print "</pre>\n" if ($html);
 }
 
 
@@ -180,7 +199,14 @@ sub FilterPackages() {
        }
 }
 
-getopts('VhHlsd:S:C:');
+sub FilterBugs() {
+       for $p (sort keys %packagelist) {
+               $packagelist{$p} = join(' ', grep { check_worry($bugs{$_}) } split / /, $packagelist{$p});
+               delete $packagelist{$p} if ($packagelist{$p} eq '');
+       }
+}
+
+getopts('VhHlstd:S:C:');
 ShowUsage if ($opt_h);
 ShowVersion if ($opt_V);
 $statusfile=$opt_S if ($opt_S);
@@ -192,6 +218,7 @@ $html=1 if ($opt_H);
 &readNMUstatus($NMUfile);
 
 &FilterPackages($opt_d) if ($opt_d);
+&FilterBugs() if ($opt_t);
 
 MakeStatistics if ($opt_s);
 if ($opt_l) {