From dde6486eabbabf83e2d7aa65cde8eadfee108bdd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 18 Oct 2012 10:36:16 -0400 Subject: [PATCH] =?UTF-8?q?nix-push:=20Add=20a=20flag=20=E2=80=98--manifes?= =?UTF-8?q?t-path=E2=80=99=20to=20write=20the=20manifest=20to=20another=20?= =?UTF-8?q?directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/nix-push.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/nix-push.in b/scripts/nix-push.in index a08a9bca4..b0124bc7a 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;