]> git.michaelhowe.org Git - packages/m/mh-sysadmin-tools.git/commitdiff
Allow specifying of dists and arches
authorMichael Howe <michael@michaelhowe.org>
Tue, 19 Mar 2013 14:50:07 +0000 (14:50 +0000)
committerMichael Howe <michael@michaelhowe.org>
Tue, 19 Mar 2013 14:50:07 +0000 (14:50 +0000)
bin/build-package

index 271384b96a01ecaaf20f48d72ecaafea1402d4e5..8583729e17ffb1362f75c6cf4159b1ef2960084a 100755 (executable)
@@ -17,14 +17,24 @@ my @debsign_opts = ();
 
 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();
 
@@ -53,10 +63,20 @@ warn "Statically defined /home/michael!";
 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: $!";