2 # vim: ts=4 sw=4 nowrap
4 # Generate some counts for the bugreports
10 $Version = "BugCount 1.1\nCopyright (C) Wichert Akkerman <wakkerma\@debian.org>\n";
11 $statusfile = "status";
12 $commentsfile = "comments";
22 $0 [-V] [-h] [-S file] [-C file]
25 -h show some (hopefully) helpfull information
26 -S use different statusfile
27 -C use different commentsfile
33 ShowUsage if ($opt_h);
34 ShowVersion if ($opt_V);
35 $statusfile=$opt_S if ($opt_S);
36 $commentsfile=$opt_C if ($opt_C);
38 &readstatus($statusfile);
39 &readcomments($commentsfile);
41 $total=0; # total number of bugs
42 $removecount=0; # Number of bugs that will disappear if packages are removed
43 $patchcount=0; # Number of bugs that have a fix proposed
44 $pendingcount=0; # Number of bugs that will have a fix uploaded RSN
45 $ignorecount=0; # Number of bugs being ignored
46 $nottestingcount=0; # Number of bugs on packages not in testing
47 $worrycount=0; # Number of bugs we're actually worried about
48 %sectcount=(); # Bugs per type
50 for $p (keys %packagelist) {
51 next if (defined $exclude{$p});
52 for $nr (sort split(/ /, $packagelist{$p})) {
53 next if (defined $exclude{$nr});
55 $pendingcount++ if ($bugs{$nr} =~ m/^\[[^]]*P/);
56 $patchcount++ if ($bugs{$nr} =~ m/^\[[^]]*\+/);
57 $ignorecount++ if ($bugs{$nr} =~ m/^\[[^]]*I/);
58 $nottestingcount++ if ($bugs{$nr} =~ m/ \[[^]]*X/);
59 if (defined $comments{$nr}) {
60 ($sect) = ($comments{$nr} =~ m/\[([^]]*)\]/);
63 unless ($bugs{$nr} =~ m/^\[[^]]*I/ or
64 $bugs{$nr} =~ m/ \[[^]]*X/ or
65 ($bugs{$nr} =~ m/ \[[^]]*[OSUE]/ and $bugs{$nr} !~ m/ \[[^]]*T/)) {
67 # print STDERR "$nr $bugs{$nr}\n";
71 if (defined($comments{$p}) && $comments{$p} =~ m/^\[REMOVE\]/) {
72 $removecount+=scalar(split(/ /,$packagelist{$p}));
76 printf("%d %d %d %d %d %d %d\n", $total, $pendingcount, $patchcount, $removecount, $ignorecount, $nottestingcount, $worrycount);