]> git.donarmstrong.com Git - bugscan.git/blobdiff - bugcounts
Add non-free-firmware to the valid sections
[bugscan.git] / bugcounts
index b0337fc01d7f68a7c88f605e54cafc3de4f3d7f6..ac49f8c405e86748dbd36b03cbe9d03a0af8d752 100755 (executable)
--- a/bugcounts
+++ b/bugcounts
@@ -1,17 +1,18 @@
 #! /usr/bin/perl
-# vim: ts=4 sw=4 nowrap
+# vim: ts=8 sw=8 nowrap
 
 # Generate some counts for the bugreports
 
 use Getopt::Std;
-require scanlib;
-require bugcfg;
+use File::Basename;
+use lib dirname(__FILE__);
+use bugcfg;
+use scanlib;
 use strict;
-use warnings;
+use warnings;
 
 my $Version            = "BugCount 1.1\nCopyright (C) Wichert Akkerman <wakkerma\@debian.org>\n";
 my $statusfile         = "status";
-my $commentsfile       = "comments";
 
 sub ShowVersion() {
        print "$Version\n";
@@ -26,50 +27,34 @@ Options:
   -V    show version
   -h    show some (hopefully) helpfull information
   -S    use different statusfile
-  -C    use different commentsfile
 EOF
        exit 0;
 }
 
-our ($opt_h,$opt_V,$opt_S,$opt_C);
+our ($opt_h,$opt_V,$opt_S);
 
-getopts('VhS:C:');
+getopts('VhS:');
 ShowUsage if ($opt_h);
 ShowVersion if ($opt_V);
 $statusfile=$opt_S if ($opt_S);
-$commentsfile=$opt_C if ($opt_C);
 
 scanlib::readstatus($statusfile);
-scanlib::readcomments($commentsfile);
 
 my $total=0;           # total number of bugs
-my $removecount=0;     # Number of bugs that will disappear if packages are removed
 my $patchcount=0;      # Number of bugs that have a fix proposed
 my $pendingcount=0;    # Number of bugs that will have a fix uploaded RSN
-my $ignorecount=0;      # Number of bugs being ignored
-my $nottestingcount=0; # Number of bugs on packages not in testing
+my $ignorecount=0;  # Number of bugs being ignored
 my $worrycount=0;      # Number of bugs we're actually worried about
-my %sectcount=();      # Bugs per type
-
-for my $p (keys %scanlib::packagelist) {
-       next if (defined $bugcfg::exclude{$p});
-       for my $nr (sort @{$scanlib::packagelist{$p}}) {
-               next if (defined $bugcfg::exclude{$nr});
-               $total++;
-               $pendingcount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*P/);
-               $patchcount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*\+/);
-               $ignorecount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*I/);
-               $nottestingcount++ if ($scanlib::bugs{$nr} =~ m/ \[[^]]*X/);
-               if (defined $scanlib::comments{$nr}) {
-                       my $sect = ($scanlib::comments{$nr} =~ m/\[([^]]*)\]/);
-                       $sectcount{$sect}++;
-               }
-               $worrycount++ if (scanlib::check_worry($scanlib::bugs{$nr}));
-       }
-
-       if (defined($scanlib::comments{$p}) && $scanlib::comments{$p} =~ m/^\[REMOVE\]/) {
-               $removecount += scalar @{$scanlib::packagelist{$p}};
-       }
+my $stablecount=0;     # Number of bugs affecting stable
+
+for my $bug (values %scanlib::bugs) {
+       $total++;
+       $pendingcount++ if ($bug->{'pending'});
+       $patchcount++ if ($bug->{'patch'});
+       $ignorecount++ if ($bug->{$bugcfg::debian_releases->{stable}.'-ignore'} ||
+                       $bug->{$bugcfg::debian_releases->{testing}.'-ignore'});
+       $worrycount++ if (scanlib::check_worry($bug));
+       $stablecount++ if (scanlib::check_worry_stable($bug));
 }
 
-printf("%d %d %d %d %d %d %d\n", $total, $pendingcount, $patchcount, $removecount, $ignorecount, $nottestingcount, $worrycount);
+printf("%d %d %d 0 %d 0 %d %d\n", $total, $pendingcount, $patchcount, $ignorecount, $worrycount, $stablecount);