]> git.donarmstrong.com Git - bugscan.git/blobdiff - make-britney-counts
Add non-free-firmware to the valid sections
[bugscan.git] / make-britney-counts
index 648ec2f6a5720d7d2a7c0a349fef2b6ff602679e..e541426384d7f6a6c67849ecdf788b3a5ed839ee 100755 (executable)
@@ -4,8 +4,10 @@
 # Generate a report britney can use
 
 use Getopt::Std;
 # Generate a report britney can use
 
 use Getopt::Std;
-require scanlib;
-require bugcfg;
+use File::Basename;
+use lib dirname(__FILE__);
+use bugcfg;
+use scanlib;
 use strict;
 # use warnings;
 
 use strict;
 # use warnings;
 
@@ -41,38 +43,56 @@ scanlib::readstatus($statusfile);
 my %testingbugs = ();
 my %unstablebugs = ();
 
 my %testingbugs = ();
 my %unstablebugs = ();
 
-for my $bug (values %scanlib::bugs) {
+while (my ($nr, $bug) = each %scanlib::bugs) {
        for my $package (split /[,\s]+/, $bug->{'package'}) {
                $package =~ y/A-Z/a-z/;
        for my $package (split /[,\s]+/, $bug->{'package'}) {
                $package =~ y/A-Z/a-z/;
-               $package = $` if ($package =~ /[^-+._a-z0-9]/);
+               $package = $` if ($package =~ /[^-+._:a-z0-9]/);
 
 
-               if (scanlib::check_worry_unstable($bug)) {
-                       ++$unstablebugs{$package};
+               # this hack is specific to britney counts, and ignores
+               # bugs tagged ignore for the next testing release
+               if (scanlib::check_worry_unstable($bug) and not $bug->{$bugcfg::debian_releases->{testing}.'-ignore'}) {
+                       push @{$unstablebugs{$package}}, $nr;
                }
                if (scanlib::check_worry($bug)) {
                }
                if (scanlib::check_worry($bug)) {
-                       ++$testingbugs{$package};
+                       push @{$testingbugs{$package}}, $nr;
                }
        }
 }
 
 open TESTING, ">", "britney/testing.new"
        or die "britney/testing.new: $!";
                }
        }
 }
 
 open TESTING, ">", "britney/testing.new"
        or die "britney/testing.new: $!";
+open TESTINGNR, ">", "britney/testing-nr.new"
+       or die "britney/testing-nr.new: $!";
 for my $pkg (sort keys %testingbugs) {
 for my $pkg (sort keys %testingbugs) {
-       print TESTING "$pkg $testingbugs{$pkg}\n";
+       print TESTING   "$pkg ", scalar @{$testingbugs{$pkg}}, "\n";
+       print TESTINGNR "$pkg ", join(',', @{$testingbugs{$pkg}}), "\n";
 }
 }
-close TESTING;
+close TESTING
+       or die "close britney/testing.new: $!";
+close TESTINGNR
+       or die "close britney/testing-nr.new: $!";
 
 open UNSTABLE, ">", "britney/unstable.new"
        or die "britney/unstable.new: $!";
 
 open UNSTABLE, ">", "britney/unstable.new"
        or die "britney/unstable.new: $!";
+open UNSTABLENR, ">", "britney/unstable-nr.new"
+       or die "britney/unstable-nr.new: $!";
 for my $pkg (sort keys %unstablebugs) {
 for my $pkg (sort keys %unstablebugs) {
-       print UNSTABLE "$pkg $unstablebugs{$pkg}\n";
+       print UNSTABLE   "$pkg ", scalar @{$unstablebugs{$pkg}}, "\n";
+       print UNSTABLENR "$pkg ", join(',', @{$unstablebugs{$pkg}}), "\n";
 }
 }
-close UNSTABLE;
+close UNSTABLE
+       or die "close britney/unstable.new: $!";
+close UNSTABLENR
+       or die "close britney/unstable-nr.new: $!";
 
 rename "britney/testing.new", "britney/testing"
        or die "renaming britney/testing.new to britney/testing: $!";
 
 rename "britney/testing.new", "britney/testing"
        or die "renaming britney/testing.new to britney/testing: $!";
+rename "britney/testing-nr.new", "britney/testing-nr"
+       or die "renaming britney/testing-nr.new to britney/testing-nr: $!";
 rename "britney/unstable.new", "britney/unstable"
        or die "renaming britney/unstable.new to britney/unstable: $!";
 rename "britney/unstable.new", "britney/unstable"
        or die "renaming britney/unstable.new to britney/unstable: $!";
+rename "britney/unstable-nr.new", "britney/unstable-nr"
+       or die "renaming britney/unstable-nr.new to britney/unstable-nr: $!";
 
 exit 0;
 
 
 exit 0;