From 22144afa8d9f8968da351618a1347072a93bd8aa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Jun 2013 11:55:15 +0200 Subject: Don't keep "disabled" substituters running For instance, it's pointless to keep copy-from-other-stores running if there are no other stores, or download-using-manifests if there are no manifests. This also speeds things up because we don't send queries to those substituters. --- scripts/download-from-binary-cache.pl.in | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/download-from-binary-cache.pl.in') diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index 10444dc61bc8..abd1f7b712c4 100644 --- a/scripts/download-from-binary-cache.pl.in +++ b/scripts/download-from-binary-cache.pl.in @@ -199,10 +199,6 @@ 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); @@ -543,6 +539,13 @@ sub downloadBinary { } +# Bail out right away if binary caches are disabled. +exit 0 if + ($Nix::Config::config{"use-binary-caches"} // "true") eq "false" || + ($Nix::Config::config{"untrusted-use-binary-caches"} // "true") eq "false"; +print "\n"; +flush STDOUT; + initCache(); -- cgit 1.4.1