2 # vim: ts=4 sw=4 nowrap
4 # Generate some counts for the bugreports
12 my $Version = "BugCount 1.1\nCopyright (C) Wichert Akkerman <wakkerma\@debian.org>\n";
13 my $statusfile = "status";
14 my $commentsfile = "comments";
24 $0 [-V] [-h] [-S file] [-C file]
27 -h show some (hopefully) helpfull information
28 -S use different statusfile
29 -C use different commentsfile
34 our ($opt_h,$opt_V,$opt_S,$opt_C);
37 ShowUsage if ($opt_h);
38 ShowVersion if ($opt_V);
39 $statusfile=$opt_S if ($opt_S);
40 $commentsfile=$opt_C if ($opt_C);
42 scanlib::readstatus($statusfile);
43 scanlib::readcomments($commentsfile);
45 my $total=0; # total number of bugs
46 my $patchcount=0; # Number of bugs that have a fix proposed
47 my $pendingcount=0; # Number of bugs that will have a fix uploaded RSN
48 my $ignorecount=0; # Number of bugs being ignored
49 my $nottestingcount=0; # Number of bugs on packages not in testing
50 my $worrycount=0; # Number of bugs we're actually worried about
51 my %sectcount=(); # Bugs per type
53 for my $p (keys %scanlib::packagelist) {
54 next if (defined $bugcfg::exclude{$p});
55 for my $nr (sort @{$scanlib::packagelist{$p}}) {
56 next if (defined $bugcfg::exclude{$nr});
58 $pendingcount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*P/);
59 $patchcount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*\+/);
60 $ignorecount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*I/);
61 $nottestingcount++ if ($scanlib::bugs{$nr} =~ m/ \[[^]]*X/);
62 if (defined $scanlib::comments{$nr}) {
63 my $sect = ($scanlib::comments{$nr} =~ m/\[([^]]*)\]/);
66 $worrycount++ if (scanlib::check_worry($scanlib::bugs{$nr}));
70 printf("%d %d %d 0 %d %d %d\n", $total, $pendingcount, $patchcount, $ignorecount, $nottestingcount, $worrycount);