diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index d121f2fc3..b930fd8d7 100644 --- a/scripts/download-from-binary-cache.pl.in +++ b/scripts/download-from-binary-cache.pl.in @@ -4,7 +4,9 @@ use strict; use Nix::Config; use Nix::Store; -my @binaryCacheUrls = ("file:///tmp/binary-cache2"); + +my @binaryCacheUrls = split / /, ($ENV{"NIX_BINARY_CACHES"} || ""); + sub getInfoFrom { my ($storePath, $pathHash, $binaryCacheUrl) = @_; @@ -12,7 +14,7 @@ sub getInfoFrom { #print STDERR "checking $infoUrl...\n"; my $s = `$Nix::Config::curl --fail --silent --location ${infoUrl}`; if ($? != 0) { - print STDERR "GOT CURL REPLY ", $? >> 8, "\n"; + #print STDERR "GOT CURL REPLY ", $? >> 8, "\n"; return undef; } my ($storePath2, $url, $compression, $fileHash, $fileSize, $narHash, $narSize, $deriver); @@ -45,6 +47,7 @@ sub getInfoFrom { } } + sub getInfo { my ($storePath) = @_; @@ -58,6 +61,7 @@ sub getInfo { return undef; } + sub downloadBinary { my ($storePath) = @_; @@ -82,6 +86,7 @@ sub downloadBinary { return 0; } + if ($ARGV[0] eq "--query") { while () {