Output testing/unstable counts britney can use.
authorSteinar H. Gunderson <sesse@rietz>
Mon, 18 Jun 2007 13:00:49 +0000 (13:00 +0000)
committerSteinar H. Gunderson <sesse@rietz>
Mon, 18 Jun 2007 13:00:49 +0000 (13:00 +0000)
make-britney-counts [new file with mode: 0755]
scanlib.pm

diff --git a/make-britney-counts b/make-britney-counts
new file mode 100755 (executable)
index 0000000..9a78432
--- /dev/null
@@ -0,0 +1,73 @@
+#!/usr/bin/perl
+# vim: ts=8 sw=8 nowrap
+
+# Generate a report britney can use
+
+use Getopt::Std;
+require scanlib;
+require bugcfg;
+use strict;
+# use warnings;
+
+my $Version            = "make-britney-count 1.0\nCopyright (C) Steinar H. Gunderson <sesse\@debian.org>\n";
+my $statusfile         = "status";
+
+sub ShowVersion() {
+       print "$Version\n";
+       exit 0;
+}
+
+sub ShowUsage() {
+       print <<EOF;
+Usage:
+  $0 [-V] [-h] [-S file]
+Options:
+  -V    show version
+  -h    show this screen
+  -S    use a different status file
+EOF
+       exit 0;
+}
+
+our ($opt_h,$opt_V,$opt_S);
+
+getopts('VhS:');
+ShowUsage() if ($opt_h);
+ShowVersion() if ($opt_V);
+$statusfile = $opt_S if ($opt_S);
+
+scanlib::readstatus($statusfile);
+
+my %testingbugs = ();
+my %unstablebugs = ();
+
+for my $bug (values %scanlib::bugs) {
+       for my $package (split /[,\s]+/, $bug->{'package'}) {
+               $package =~ y/A-Z/a-z/;
+               $package = $` if ($package =~ /[^-+._a-z0-9]/);
+
+               if (scanlib::check_worry_unstable($bug)) {
+                       ++$unstablebugs{$package};
+               }
+               if (scanlib::check_worry($bug)) {
+                       ++$testingbugs{$package};
+               }
+       }
+}
+
+open TESTING, ">", "britney/testing"
+       or die "britney/testing: $!";
+for my $pkg (sort keys %testingbugs) {
+       print TESTING "$pkg $testingbugs{$pkg}\n";
+}
+close TESTING;
+
+open UNSTABLE, ">", "britney/unstable"
+       or die "britney/unstable: $!";
+for my $pkg (sort keys %unstablebugs) {
+       print UNSTABLE "$pkg $unstablebugs{$pkg}\n";
+}
+close UNSTABLE;
+
+exit 0;
+
index 9bd8458..50a6951 100644 (file)
@@ -83,6 +83,7 @@ sub readpackages() {
                                next unless m/^Package:\s/;     # We're only interested in the packagenames
                                s/^Package:\s*//;                       # Strip the fieldname
                                $section{$_} = "$archive/$sect";
+                               print "$root/$sect/binary-$arch/Packages.gz\n" if ($_ eq 'xtla');
                        }
                        close(P);
                }
@@ -326,6 +327,12 @@ sub check_worry_stable {
        return ($bi->{'stable'} && !$bi->{'etch-ignore'});
 }
 
+sub check_worry_unstable {
+       my ($bi) = @_;
+
+       return ($bi->{'unstable'});
+}
+
 sub get_taginfo {
     my $bi = shift;