2 # vim: ts=8 sw=8 nowrap
4 # Generate a report britney can use
12 my $Version = "make-britney-count 1.0\nCopyright (C) Steinar H. Gunderson <sesse\@debian.org>\n";
13 my $statusfile = "status";
23 $0 [-V] [-h] [-S file]
27 -S use a different status file
32 our ($opt_h,$opt_V,$opt_S);
35 ShowUsage() if ($opt_h);
36 ShowVersion() if ($opt_V);
37 $statusfile = $opt_S if ($opt_S);
39 scanlib::readstatus($statusfile);
42 my %unstablebugs = ();
44 for my $bug (values %scanlib::bugs) {
45 for my $package (split /[,\s]+/, $bug->{'package'}) {
46 $package =~ y/A-Z/a-z/;
47 $package = $` if ($package =~ /[^-+._a-z0-9]/);
49 if (scanlib::check_worry_unstable($bug)) {
50 ++$unstablebugs{$package};
52 if (scanlib::check_worry($bug)) {
53 ++$testingbugs{$package};
58 open TESTING, ">", "britney/testing.new"
59 or die "britney/testing.new: $!";
60 for my $pkg (sort keys %testingbugs) {
61 print TESTING "$pkg $testingbugs{$pkg}\n";
65 open UNSTABLE, ">", "britney/unstable.new"
66 or die "britney/unstable.new: $!";
67 for my $pkg (sort keys %unstablebugs) {
68 print UNSTABLE "$pkg $unstablebugs{$pkg}\n";
72 rename "britney/testing.new", "britney/testing"
73 or die "renaming britney/testing.new to britney/testing: $!";
74 rename "britney/unstable.new", "britney/unstable"
75 or die "renaming britney/unstable.new to britney/unstable: $!";