]> git.michaelhowe.org Git - packages/m/mh-sysadmin-tools.git/commitdiff
build-package: support for specific output dir
authorMichael Howe <michael@michaelhowe.org>
Mon, 25 Dec 2023 17:20:26 +0000 (17:20 +0000)
committerMichael Howe <michael@michaelhowe.org>
Mon, 25 Dec 2023 17:20:26 +0000 (17:20 +0000)
This helps with multiple builds

bin/build-package

index 5c8b9c3f37af848c76cf8f5e584f4e7e9db9b561..e6a7ffc0ca53bfcf40a14b46c328136fd1f2a1b0 100755 (executable)
@@ -31,6 +31,7 @@ my @dists;   # = 'squeeze';
 my $dsc;     # optional; allows use of a dsc directly
 my $os = 'debian';
 my $binary_only;
+my $local_outputdir;
 
 GetOptions(
     "arch=s"    => \@archs,
@@ -38,6 +39,7 @@ GetOptions(
     "os=s"      => \$os,
     "dsc=s"     => \$dsc,
     'binary-only'   => \$binary_only,
+    "output-dir=s"  => \$local_outputdir,
 );
 
 my $path = $ARGV[0];
@@ -151,7 +153,13 @@ print "Running @cowpokecmd";
 system( @cowpokecmd ) == 0
     or die "Could not run cowpoke: $!";
 
-my $local_outputdir = tempdir( DIR => $workingdir );
+if( $local_outputdir ){
+    if( ! -d $local_outputdir ){
+        mkdir "$local_outputdir" or die "Could not mkdir $local_outputdir: $!"
+    }
+} else {
+    $local_outputdir = tempdir( DIR => $workingdir );
+}
 
 my @rsynccmd = ( $rsync, "-az", "$buildhost:$remote_outputdir/", "$local_outputdir/" );
 print "Running @rsynccmd\n";