about summary refs log tree commit diff
path: root/scripts/download-from-binary-cache.pl.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-06T12·44+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-06T12·44+0100
commit620e92e880f8a011c5f465ea4fee2abf857d4ab2 (patch)
treec0dd50bfdc39cb781ec0ff59259155630b4b4d4b /scripts/download-from-binary-cache.pl.in
parentdf27db712df658dc9b7548b55fd65a15515d4d85 (diff)
Add an option ‘use-binary-caches’
This allows disabling the use of binary caches, e.g.

  $ nix-build ... --option use-binary-caches false

Note that

  $ nix-build ... --option binary-caches ''

does not disable all binary caches, since the caches defined by
channels will still be used.
Diffstat (limited to 'scripts/download-from-binary-cache.pl.in')
-rw-r--r--scripts/download-from-binary-cache.pl.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in
index 74df79d8fed2..a018b3b2ad5b 100644
--- a/scripts/download-from-binary-cache.pl.in
+++ b/scripts/download-from-binary-cache.pl.in
@@ -177,6 +177,10 @@ sub getAvailableCaches {
     return if $gotCaches;
     $gotCaches = 1;
 
+    return if
+        ($Nix::Config::config{"use-binary-caches"} // "true") eq "false" ||
+        ($Nix::Config::config{"untrusted-use-binary-caches"} // "true") eq "false";
+
     sub strToList {
         my ($s) = @_;
         return map { s/\/+$//; $_ } split(/ /, $s);