diff options
Diffstat (limited to 'scripts/download-from-binary-cache.pl.in')
-rw-r--r-- | scripts/download-from-binary-cache.pl.in | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index d121f2fc3151..b930fd8d72c1 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 (<STDIN>) { |