forked from lix-project/lix
download-from-binary-cache: Print correct URL
This commit is contained in:
parent
fe241ece29
commit
aa115e22df
|
@ -214,6 +214,8 @@ sub processNARInfo {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# FIXME: validate $url etc. for security.
|
||||||
|
|
||||||
# Cache the result.
|
# Cache the result.
|
||||||
$insertNAR->execute(
|
$insertNAR->execute(
|
||||||
$cacheId, basename($storePath), $url, $compression, $fileHash, $fileSize,
|
$cacheId, basename($storePath), $url, $compression, $fileHash, $fileSize,
|
||||||
|
@ -417,8 +419,9 @@ sub downloadBinary {
|
||||||
print STDERR "unknown compression method ‘$info->{compression}’\n";
|
print STDERR "unknown compression method ‘$info->{compression}’\n";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
print STDERR "\n*** Downloading ‘$info->{url}’ into ‘$storePath’...\n";
|
my $url = "$binaryCacheUrl/$info->{url}"; # FIXME: handle non-relative URLs
|
||||||
if (system("$Nix::Config::curl --fail --location $binaryCacheUrl/$info->{url} | $decompressor | $Nix::Config::binDir/nix-store --restore $storePath") != 0) {
|
print STDERR "\n*** Downloading ‘$url’ into ‘$storePath’...\n";
|
||||||
|
if (system("$Nix::Config::curl --fail --location '$url' | $decompressor | $Nix::Config::binDir/nix-store --restore $storePath") != 0) {
|
||||||
die "download of `$info->{url}' failed" . ($! ? ": $!" : "") . "\n" unless $? == 0;
|
die "download of `$info->{url}' failed" . ($! ? ": $!" : "") . "\n" unless $? == 0;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue