my $buildhost = "wowbagger.internal.michaelhowe.org";
-my $arch = 'amd64';
-my $dist = 'squeeze';
+my @archs; # = 'amd64';
+my @dists; # = 'squeeze';
+
+GetOptions(
+ "arch=s" => \@archs,
+ "dist=s" => \@dists,
+);
my $path = $ARGV[0];
unless( $path ){
die "Error - no path specified\n";
}
+die "Error - arch not defined (use --arch)\n"
+ unless( @archs );
+
+die "Error - dist not defined (use --dist)\n"
+ unless( @dists );
my $workingdir = getcwd();
my $remote_outputdir = "/home/michael/cowbuilder-outgoing/$$"; # FIXME
$ENV{INCOMING_DIR} = $remote_uploaddir;
-my $resdirname = "${arch}_${dist}_RESULT_DIR";
-$ENV{$resdirname} = "$remote_outputdir";
-my @cowpokecmd = ( $cowpoke, "--arch=$arch", "--dist=$dist", $dscfile );
+foreach my $arch ( @archs ){
+ foreach my $dist ( @dists ){
+ my $resdirname = "${arch}_${dist}_RESULT_DIR";
+ $ENV{$resdirname} = "$remote_outputdir";
+ }
+}
+my $archcmds = "--arch=" . join( " ", @archs );
+my $distcmds = "--dist=" . join( " ", @dists );
+
+#my @archcmds = map { "--arch=" . $_ } @archs;
+#my @distcmds = map { "--dist=" . $_ } @dists;
+
+my @cowpokecmd = ( $cowpoke, $archcmds, $distcmds, $dscfile );
print "Running @cowpokecmd";
system( @cowpokecmd ) == 0
or die "Could not run cowpoke: $!";