10 while( @ARGV && $ARGV[0] =~ /^-/ ) {
12 if (/^-d/ || /^--dist/) {
13 if (/^-d(.)/ || /^--dist=(.)/) {
17 die "$_ option missing argument\n";
22 $dist = "oldstable" if $dist eq "o";
23 $dist = "stable" if $dist eq "s";
24 $dist = "tesing" if $dist eq "t";
25 $dist = "unstable" if $dist eq "u";
26 die "Bad distribution\n" if !isin($dist, qw(oldstable stable testing unstable));
31 elsif (/^-p$/ || /^--previously-built$/) {
32 $previously_built = 1;
35 die "Unknown option: $_\n";
39 my $date=`date -u "+%m/%d/%Y %T"`;
43 my @archs = qw(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 amd64 sparc armel kfreebsd-amd64 kfreebsd-i386);
46 foreach $arch (@archs) {
48 my($lastmsg, %n_state, $total, %n_builder, $pu_total);
50 $n_state{"Installed"} = 0;
51 open( PIPE, "wanna-build --database=$arch/build-db --dist=$dist --list=all 2>&1 |" )
52 or die "Cannot spawn wanna-build: $!\n";
54 if (/^Database for $dist doesn't exist$/) {
57 elsif (/^Total (\d+) package\(s\) in state (\S+)\.$/) {
59 $pu_total += $1 if ( $2 eq "Installed" );
61 elsif (/^Total (\d+) package\(s\)$/) {
64 elsif (/: Installed (?:by [\w-]+ )?\[[\w-]*:/) {
67 elsif (/: [\w-]+ (?:by [\w-]+ )?\[\w+:(out-of-date|partial)/) {
76 # $total -= $n_state{"Not-For-Us"};
77 if ( $previously_built ) {
78 print ", ".$n_state{"Installed"}.", ".$pu_total;
80 print ", ".$n_state{"Installed"}.", ".$total;
90 return grep( $_ eq $val, @_ );