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 $removecount=0; # Number of bugs that will disappear if packages are removed
47 my $patchcount=0; # Number of bugs that have a fix proposed
48 my $pendingcount=0; # Number of bugs that will have a fix uploaded RSN
49 my $ignorecount=0; # Number of bugs being ignored
50 my $nottestingcount=0; # Number of bugs on packages not in testing
51 my $worrycount=0; # Number of bugs we're actually worried about
52 my %sectcount=(); # Bugs per type
54 for my $p (keys %scanlib::packagelist) {
55 next if (defined $bugcfg::exclude{$p});
56 for my $nr (sort @{$scanlib::packagelist{$p}}) {
57 next if (defined $bugcfg::exclude{$nr});
59 $pendingcount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*P/);
60 $patchcount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*\+/);
61 $ignorecount++ if ($scanlib::bugs{$nr} =~ m/^\[[^]]*I/);
62 $nottestingcount++ if ($scanlib::bugs{$nr} =~ m/ \[[^]]*X/);
63 if (defined $scanlib::comments{$nr}) {
64 my $sect = ($scanlib::comments{$nr} =~ m/\[([^]]*)\]/);
67 unless ($scanlib::bugs{$nr} =~ m/^\[[^]]*I/ or
68 $scanlib::bugs{$nr} =~ m/ \[[^]]*X/ or
69 ($scanlib::bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $scanlib::bugs{$nr} !~ m/ \[[^]]*T/)) {
71 # print STDERR "$nr $bugs{$nr}\n";
75 if (defined($scanlib::comments{$p}) && $scanlib::comments{$p} =~ m/^\[REMOVE\]/) {
76 $removecount += scalar @{$scanlib::packagelist{$p}};
80 printf("%d %d %d %d %d %d %d\n", $total, $pendingcount, $patchcount, $removecount, $ignorecount, $nottestingcount, $worrycount);