]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build-statistics
Auto-committed schema changes.
[wannabuild.git] / bin / wanna-build-statistics
index a7cb158b69a3c5ab375080da2d95e54f9af30e46..6719306c8e76e9cb0b741dd2aaa82d9cd8313357 100755 (executable)
@@ -38,7 +38,7 @@ use strict;
 use vars qw($verbose $dist $database);
 
 $verbose = 0;
-$dist = "unstable";
+$dist = "sid";
 $database = "build-db";
 
 while( @ARGV && $ARGV[0] =~ /^-/ ) {
@@ -56,10 +56,6 @@ while( @ARGV && $ARGV[0] =~ /^-/ ) {
                else {
                        $dist = shift @ARGV;
                }
-               $dist = "stable"   if $dist eq "s";
-               $dist = "testing"  if $dist eq "t";
-               $dist = "unstable" if $dist eq "u";
-               die "Bad distribution\n" if !isin($dist, qw(stable testing unstable stable-security testing-security oldstable oldstable-security));
        }
        elsif (/^--$/) {
                last;
@@ -73,9 +69,9 @@ while( @ARGV && $ARGV[0] =~ /^-/ ) {
 }
 
 my($lastmsg, %n_state, $total, %n_builder);
-open( PIPE, "wanna-build --database=$database --dist=$dist --list=all 2>&1 |" )
+open( my $pipe, '-|', "wanna-build --database=$database --dist=$dist --list=all 2>&1" )
        or die "Cannot spawn wanna-build: $!\n";
-while( <PIPE> ) {
+while( <$pipe> ) {
        if (/^Database for $dist doesn't exist$/) {
                exit 1;
        }
@@ -90,7 +86,7 @@ while( <PIPE> ) {
        }
        $lastmsg = $_;
 }
-close( PIPE );
+close( $pipe );
 if ($?) {
        print "$lastmsg";
        die "Bad exit status $? from wanna-build\n";
@@ -101,7 +97,7 @@ print "--------------", "-" x length($dist), "\n";
 
 my $total_width = 78;
 my @state_list = qw(Installed Needs-Build Building Built Build-Attempted Uploaded Failed Dep-Wait
-                                       Failed-Removed Dep-Wait-Removed
+                                       Failed-Removed Dep-Wait-Removed BD-Uninstallable
                                        Not-For-Us);
 my $statewidth = 0;
 grep { $statewidth = length($_) if length($_) > $statewidth } @state_list;
@@ -147,7 +143,7 @@ print percent(qw(Built Installed Uploaded)), " if also counting built pkgs\n";
 print percent(qw(Needs-Build)), " uncompiled\n";
 print percent(qw(Building)), " currently building (short-term delay)\n";
 print percent(qw(Build-Attempted)), " currently failed building (short-term delay)\n";
-print percent(qw(Failed Dep-Wait)), " failed or waiting (long-term delay)\n";
+print percent(qw(Failed BD-Uninstallable Dep-Wait)), " failed or waiting (long-term delay)\n";
 
 exit 0;