X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bin%2Fwanna-build-statistics;h=6719306c8e76e9cb0b741dd2aaa82d9cd8313357;hb=43c14620e569a6923bbf360cef7f53754505a245;hp=e828121266d061bee7bf07200b2dc016ec5399c9;hpb=ca63323f793d72b60f0574eb4202eb3a0c64618f;p=wannabuild.git diff --git a/bin/wanna-build-statistics b/bin/wanna-build-statistics index e828121..6719306 100755 --- a/bin/wanna-build-statistics +++ b/bin/wanna-build-statistics @@ -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,11 +56,6 @@ while( @ARGV && $ARGV[0] =~ /^-/ ) { else { $dist = shift @ARGV; } - $dist = "oldstable" if $dist eq "o"; - $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; @@ -74,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( ) { +while( <$pipe> ) { if (/^Database for $dist doesn't exist$/) { exit 1; } @@ -91,7 +86,7 @@ while( ) { } $lastmsg = $_; } -close( PIPE ); +close( $pipe ); if ($?) { print "$lastmsg"; die "Bad exit status $? from wanna-build\n";