10 while( @ARGV && $ARGV[0] =~ /^-/ ) {
12 if (/^-d/ || /^--dist/) {
13 if (/^-d(.)/ || /^--dist=(.)/) {
17 die "$_ option missing argument\n";
26 elsif (/^-p$/ || /^--previously-built$/) {
27 $previously_built = 1;
30 die "Unknown option: $_\n";
34 my $date=`date -u "+%m/%d/%Y %T"`;
38 my @archs = qw(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 amd64 sparc armel kfreebsd-amd64 kfreebsd-i386);
41 foreach $arch (@archs) {
43 my($lastmsg, %n_state, $total, %n_builder, $pu_total);
45 $n_state{"Installed"} = 0;
46 open( my $pipe, '-|', "wanna-build --database=$arch/build-db --dist=$dist --list=all" )
47 or die "Cannot spawn wanna-build: $!\n";
49 if (/^Database for $dist doesn't exist$/) {
52 elsif (/^Total (\d+) package\(s\) in state (\S+)\.$/) {
54 $pu_total += $1 if ( $2 eq "Installed" );
56 elsif (/^Total (\d+) package\(s\)$/) {
59 elsif (/: Installed (?:by [\w-]+ )?\[[\w-]*:/) {
62 elsif (/: [\w-]+ (?:by [\w-]+ )?\[\w+:(out-of-date|partial)/) {
71 # $total -= $n_state{"Not-For-Us"};
72 if ( $previously_built ) {
73 print ", ".$n_state{"Installed"}.", ".$pu_total;
75 print ", ".$n_state{"Installed"}.", ".$total;
85 return grep( $_ eq $val, @_ );