diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-10-18T14·36-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-10-18T14·36-0400 |
commit | dde6486eabbabf83e2d7aa65cde8eadfee108bdd (patch) | |
tree | 5c7051faa6b790a2c2c19ab85700a2568acf4e3e /scripts/nix-push.in | |
parent | c8daeba30328c83328b632f8f45920d85d7d1968 (diff) |
nix-push: Add a flag ‘--manifest-path’ to write the manifest to another directory
Diffstat (limited to 'scripts/nix-push.in')
-rwxr-xr-x | scripts/nix-push.in | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/nix-push.in b/scripts/nix-push.in index a08a9bca4715..b0124bc7a479 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; |