]> git.donarmstrong.com Git - bugscan.git/blob - bugcounts
wwwnumber and wwwname take arguments; () is wrong.
[bugscan.git] / bugcounts
1 #! /usr/bin/perl
2 # vim: ts=8 sw=8 nowrap
3
4 # Generate some counts for the bugreports
5
6 use Getopt::Std;
7 use File::Basename;
8 use lib dirname(__FILE__);
9 use bugcfg;
10 use scanlib;
11 use strict;
12 # use warnings;
13
14 my $Version             = "BugCount 1.1\nCopyright (C) Wichert Akkerman <wakkerma\@debian.org>\n";
15 my $statusfile          = "status";
16
17 sub ShowVersion() {
18         print "$Version\n";
19         exit 0;
20 }
21
22 sub ShowUsage() {
23         print <<EOF;
24 Usage:
25   $0 [-V] [-h] [-S file] [-C file]
26 Options:
27   -V    show version
28   -h    show some (hopefully) helpfull information
29   -S    use different statusfile
30 EOF
31         exit 0;
32 }
33
34 our ($opt_h,$opt_V,$opt_S);
35
36 getopts('VhS:');
37 ShowUsage if ($opt_h);
38 ShowVersion if ($opt_V);
39 $statusfile=$opt_S if ($opt_S);
40
41 scanlib::readstatus($statusfile);
42
43 my $total=0;            # total number of bugs
44 my $patchcount=0;       # Number of bugs that have a fix proposed
45 my $pendingcount=0;     # Number of bugs that will have a fix uploaded RSN
46 my $ignorecount=0;  # Number of bugs being ignored
47 my $worrycount=0;       # Number of bugs we're actually worried about
48 my $stablecount=0;      # Number of bugs affecting stable
49
50 for my $bug (values %scanlib::bugs) {
51         $total++;
52         $pendingcount++ if ($bug->{'pending'});
53         $patchcount++ if ($bug->{'patch'});
54         $ignorecount++ if ($bug->{$bugcfg::debian_releases->{stable}.'-ignore'} ||
55                        $bug->{$bugcfg::debian_releases->{testing}.'-ignore'});
56         $worrycount++ if (scanlib::check_worry($bug));
57         $stablecount++ if (scanlib::check_worry_stable($bug));
58 }
59
60 printf("%d %d %d 0 %d 0 %d %d\n", $total, $pendingcount, $patchcount, $ignorecount, $worrycount, $stablecount);