summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-18 10:36:16 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-18 10:36:16 -0400
commitdde6486eabbabf83e2d7aa65cde8eadfee108bdd (patch)
tree5c7051faa6b790a2c2c19ab85700a2568acf4e3e /scripts
parentc8daeba30328c83328b632f8f45920d85d7d1968 (diff)
downloadguix-dde6486eabbabf83e2d7aa65cde8eadfee108bdd.tar.gz
nix-push: Add a flag ‘--manifest-path’ to write the manifest to another directory
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/nix-push.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/nix-push.in b/scripts/nix-push.in
index a08a9bca47..b0124bc7a4 100755
--- a/scripts/nix-push.in
+++ b/scripts/nix-push.in
@@ -22,6 +22,7 @@ my $compressionType = "xz";
 my $force = 0;
 my $destDir;
 my $writeManifest = 0;
+my $manifestPath;
 my $archivesURL;
 my $link = 0;
 my @roots;
@@ -42,6 +43,12 @@ for (my $n = 0; $n < scalar @ARGV; $n++) {
         mkpath($destDir, 0, 0755);
     } elsif ($arg eq "--manifest") {
         $writeManifest = 1;
+    } elsif ($arg eq "--manifest-path") {
+        $n++;
+        die "$0: `$arg' requires an argument\n" unless $n < scalar @ARGV;
+        $manifestPath = $ARGV[$n];
+        $writeManifest = 1;
+        mkpath(dirname($manifestPath), 0, 0755);
     } elsif ($arg eq "--url-prefix") {
         $n++;
         die "$0: `$arg' requires an argument\n" unless $n < scalar @ARGV;
@@ -267,4 +274,4 @@ printf STDERR "total compressed size %.2f MiB, %.1f%%\n",
 
 
 # Optionally write a manifest.
-writeManifest "$destDir/MANIFEST", \%narFiles, \() if $writeManifest;
+writeManifest($manifestPath // "$destDir/MANIFEST", \%narFiles, \()) if $writeManifest;