10 while( @ARGV && $ARGV[0] =~ /^-/ ) {
12 if (/^-d/ || /^--dist/) {
13 if (/^-d(.)/ || /^--dist=(.)/) {
17 die "$_ option missing argument\n";
22 $dist = "stable" if $dist eq "s";
23 $dist = "frozen" if $dist eq "f";
24 $dist = "unstable" if $dist eq "u";
25 die "Bad distribution\n" if !isin($dist, qw(stable testing unstable));
30 elsif (/^-p$/ || /^--previously-built$/) {
31 $previously_built = 1;
34 die "Unknown option: $_\n";
38 my $date=`date +%m/%d/%Y`;
42 my @archs = qw(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 amd64 sparc armel);
45 foreach $arch (@archs) {
47 my($lastmsg, %n_state, $total, %n_builder, $pu_total);
49 $n_state{"Installed"} = 0;
50 open( PIPE, "wanna-build --database=$arch/build-db --dist=$dist --list=all 2>&1 |" )
51 or die "Cannot spawn wanna-build: $!\n";
53 if (/^Database for $dist doesn't exist$/) {
56 elsif (/^Total (\d+) package\(s\) in state (\S+)\.$/) {
58 $pu_total += $1 if ( $2 eq "Installed" );
60 elsif (/^Total (\d+) package\(s\)$/) {
63 elsif (/: Installed (?:by [\w-]+ )?\[[\w-]*:/) {
66 elsif (/: [\w-]+ (?:by [\w-]+ )?\[\w+:(out-of-date|partial)/) {
75 # $total -= $n_state{"Not-For-Us"};
76 if ( $previously_built ) {
77 print ", ".$n_state{"Installed"}.", ".$pu_total;
79 print ", ".$n_state{"Installed"}.", ".$total;
89 return grep( $_ eq $val, @_ );