From 67c6f3eded7dcb7c79243ed41f177c960f2b6aad Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Jul 2012 18:28:12 -0400 Subject: nix-push: Support generating a manifest again This makes all the tests succeed. Woohoo! --- scripts/nix-push.in | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/nix-push.in b/scripts/nix-push.in index 45a0695a64d7..39fdd6da9e39 100755 --- a/scripts/nix-push.in +++ b/scripts/nix-push.in @@ -8,31 +8,28 @@ use File::stat; use File::Copy; use Nix::Config; use Nix::Store; - -my $hashAlgo = "sha256"; +use Nix::Manifest; my $tmpDir = tempdir("nix-push.XXXXXX", CLEANUP => 1, TMPDIR => 1) or die "cannot create a temporary directory"; my $nixExpr = "$tmpDir/create-nars.nix"; -my $curl = "$Nix::Config::curl --fail --silent"; -my $extraCurlFlags = ${ENV{'CURL_FLAGS'}}; -$curl = "$curl $extraCurlFlags" if defined $extraCurlFlags; - # Parse the command line. my $compressionType = "xz"; my $force = 0; my $destDir; +my $writeManifest = 0; +my $archivesURL; my @roots; sub showSyntax { print STDERR < "$archivesURL/$narName" + , hash => "sha256:$compressedHash" + , size => $compressedSize + , narHash => "$narHash" + , narSize => $narSize + , references => join(" ", @{$refs}) + , deriver => $deriver + } + ] if $writeManifest; } printf STDERR "total compressed size %.2f MiB, %.1f%%\n", $totalCompressedSize / (1024 * 1024), $totalCompressedSize / $totalNarSize * 100; + + +# Optionally write a manifest. +if ($writeManifest) { + writeManifest "$destDir/MANIFEST", \%narFiles, \(); +} -- cgit 1.4.1