X-Git-Url: https://git.donarmstrong.com/?p=bugscan.git;a=blobdiff_plain;f=bugcounts;h=15455ab6e8f9bb9399da0e9bc971a234b0056f1a;hp=8792983eaa70c24f356d636a9586c40568332eb7;hb=882c3a5e8e8d32eb965a7d1f805f8ea31668b91c;hpb=d5a0b74a3ddd8ad47fb594e890dfd0f454627655 diff --git a/bugcounts b/bugcounts index 8792983..15455ab 100755 --- a/bugcounts +++ b/bugcounts @@ -1,15 +1,16 @@ #! /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 strict; +# use warnings; -$Version = "BugCount 1.1\nCopyright (C) Wichert Akkerman \n"; -$statusfile = "status"; -$commentsfile = "comments"; +my $Version = "BugCount 1.1\nCopyright (C) Wichert Akkerman \n"; +my $statusfile = "status"; sub ShowVersion() { print "$Version\n"; @@ -24,51 +25,34 @@ Options: -V show version -h show some (hopefully) helpfull information -S use different statusfile - -C use different commentsfile EOF exit 0; } -getopts('VhS:C:'); +our ($opt_h,$opt_V,$opt_S); + +getopts('VhS:'); ShowUsage if ($opt_h); ShowVersion if ($opt_V); $statusfile=$opt_S if ($opt_S); -$commentsfile=$opt_C if ($opt_C); - -&readstatus($statusfile); -&readcomments($commentsfile); - -$total=0; # total number of bugs -$removecount=0; # Number of bugs that will disappear if packages are removed -$patchcount=0; # Number of bugs that have a fix proposed -$pendingcount=0; # Number of bugs that will have a fix uploaded RSN -$ignorecount=0; # Number of bugs being ignored -$nottestingcount=0; # Number of bugs on packages not in testing -$worrycount=0; # Number of bugs we're actually worried about -%sectcount=(); # Bugs per type - -for $p (keys %packagelist) { - next if (defined $exclude{$p}); - for $nr (sort split(/ /, $packagelist{$p})) { - next if (defined $exclude{$nr}); - $total++; - $pendingcount++ if ($bugs{$nr} =~ m/^\[[^]]*P/); - $patchcount++ if ($bugs{$nr} =~ m/^\[[^]]*\+/); - $ignorecount++ if ($bugs{$nr} =~ m/^\[[^]]*I/); - $nottestingcount++ if ($bugs{$nr} =~ m/ \[[^]]*X/); - if (defined $comments{$nr}) { - ($sect) = ($comments{$nr} =~ m/\[([^]]*)\]/); - $sectcount{$sect}++; - } - $worrycount++ unless ( - $bugs{$nr} =~ m/^\[[^]]*I/ or - $bugs{$nr} =~ m/ \[[^]]*X/ or - ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/)); - } - if (defined($comments{$p}) && $comments{$p} =~ m/^\[REMOVE\]/) { - $removecount+=scalar(split(/ /,$packagelist{$p})); - } +scanlib::readstatus($statusfile); + +my $total=0; # total number of bugs +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 $worrycount=0; # Number of bugs we're actually worried about +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->{$debian_releases->{stable}.'-ignore'} || + $bug->{$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);