* Store the NAR size in the manifest.

This commit is contained in:
Eelco Dolstra 2010-11-17 12:57:52 +00:00
parent 5693b8a7e2
commit 06699d4219
2 changed files with 7 additions and 1 deletions

View file

@ -193,6 +193,10 @@ for (my $n = 0; $n < scalar @storePaths; $n++) {
die "cannot query hash for `$storePath'" if $? != 0;
chomp $narHash;
my $narSize = `$binDir/nix-store --query --size '$storePath'`;
die "cannot query size for `$storePath'" if $? != 0;
chomp $narSize;
my $url;
if ($localCopy) {
$url = "$targetArchivesUrl/$narName";
@ -204,6 +208,7 @@ for (my $n = 0; $n < scalar @storePaths; $n++) {
, hash => "$hashAlgo:$narbz2Hash"
, size => $narbz2Size
, narHash => "$narHash"
, narSize => $narSize
, references => $references
, deriver => $deriver
}

View file

@ -165,8 +165,9 @@ sub writeManifest {
print MANIFEST " StorePath: $storePath\n";
print MANIFEST " NarURL: $narFile->{url}\n";
print MANIFEST " Hash: $narFile->{hash}\n" if defined $narFile->{hash};
print MANIFEST " NarHash: $narFile->{narHash}\n";
print MANIFEST " Size: $narFile->{size}\n" if defined $narFile->{size};
print MANIFEST " NarHash: $narFile->{narHash}\n";
print MANIFEST " NarSize: $narFile->{narSize}\n" if $narFile->{narSize};
print MANIFEST " References: $narFile->{references}\n"
if defined $narFile->{references} && $narFile->{references} ne "";
print MANIFEST " Deriver: $narFile->{deriver}\n"