From 717144f2f0a6bda675590d35c4ce90689f39819f Mon Sep 17 00:00:00 2001 From: Michael Howe Date: Tue, 19 Mar 2013 14:50:07 +0000 Subject: [PATCH] Allow specifying of dists and arches --- bin/build-package | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/bin/build-package b/bin/build-package index 271384b..8583729 100755 --- a/bin/build-package +++ b/bin/build-package @@ -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: $!"; -- 2.39.5