Update queryPathInfo calls

This commit is contained in:
Eelco Dolstra 2012-07-18 23:14:45 +02:00
parent da960b507d
commit 2ab4c7d597
3 changed files with 4 additions and 6 deletions

View file

@ -12,14 +12,12 @@ sub process {
$c->response->content_type('text/x-nix-narinfo'); # !!! check MIME type $c->response->content_type('text/x-nix-narinfo'); # !!! check MIME type
my ($deriver, $narHash, $time, $narSize, $refs) = queryPathInfo($storePath); my ($deriver, $narHash, $time, $narSize, $refs) = queryPathInfo($storePath, 1);
my $info; my $info;
$info .= "StorePath: $storePath\n"; $info .= "StorePath: $storePath\n";
$info .= "URL: nar/" . basename $storePath. "\n"; $info .= "URL: nar/" . basename $storePath. "\n";
$info .= "Compression: bzip2\n"; $info .= "Compression: bzip2\n";
#$info .= "FileHash: sha256:$compressedHash\n";
#$info .= "FileSize: $compressedSize\n";
$info .= "NarHash: $narHash\n"; $info .= "NarHash: $narHash\n";
$info .= "NarSize: $narSize\n"; $info .= "NarSize: $narSize\n";
$info .= "References: " . join(" ", map { basename $_ } @{$refs}) . "\n"; $info .= "References: " . join(" ", map { basename $_ } @{$refs}) . "\n";

View file

@ -21,7 +21,7 @@ sub process {
"}\n"; "}\n";
foreach my $path (@paths) { foreach my $path (@paths) {
my ($deriver, $hash, $time, $narSize, $refs) = queryPathInfo $path; my ($deriver, $hash, $time, $narSize, $refs) = queryPathInfo($path, 0);
# Escape the characters that are allowed to appear in a Nix # Escape the characters that are allowed to appear in a Nix
# path name but have special meaning in a URI. # path name but have special meaning in a URI.

View file

@ -385,12 +385,12 @@ sub doBuild {
my $closuresize = 0; my $closuresize = 0;
if (isValidPath($outPath)) { if (isValidPath($outPath)) {
my ($deriver, $hash, $time, $narSize, $refs) = queryPathInfo($outPath); my ($deriver, $hash, $time, $narSize, $refs) = queryPathInfo($outPath, 0);
$size = $narSize; $size = $narSize;
my @closure = computeFSClosure(0, 0, $outPath); my @closure = computeFSClosure(0, 0, $outPath);
foreach my $path (@closure) { foreach my $path (@closure) {
my ($deriver, $hash, $time, $narSize, $refs) = queryPathInfo($path); my ($deriver, $hash, $time, $narSize, $refs) = queryPathInfo($path, 0);
$closuresize += $narSize; $closuresize += $narSize;
} }
} }