diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-02T01·55-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-02T01·55-0400 |
commit | 440adfbdd1c99fdf7929db66b64ccf4dcd9097e3 (patch) | |
tree | 0d4391aa5491b9c6b37becd94c41ba90849faa60 /scripts/download-from-binary-cache.pl.in | |
parent | f4190c38bac1efdbfec9b1ff9c524808d23fe1cc (diff) |
Add an environment variable $NIX_BINARY_CACHES specifying URLs of binary caches
Diffstat (limited to '')
-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>) { |