about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-07T20·46+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-07T20·46+0200
commit57695d8f7630581c53ab37fe4123f92a3b1f426e (patch)
tree8d8a6e147d6b6d99ed3c2ae23a34f45b6d9e3c55
parent6e1f4c14882ad1cae043999f92ce7966fc0eee4b (diff)
Warn about untrusted binary caches in extra-binary-caches
-rw-r--r--scripts/download-from-binary-cache.pl.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in
index a3af75f739b0..49f829b684dc 100644
--- a/scripts/download-from-binary-cache.pl.in
+++ b/scripts/download-from-binary-cache.pl.in
@@ -237,7 +237,7 @@ sub getAvailableCaches {
         my @untrustedUrls = strToList $Nix::Config::config{"untrusted-binary-caches"};
         @urls = ();
         foreach my $url (@untrustedUrls) {
-            die "binary cache ‘$url’ is not trusted (please add it to ‘trusted-binary-caches’ [@trustedUrls] in $Nix::Config::confDir/nix.conf)\n"
+            die "binary cache ‘$url’ is not trusted (please add it to ‘trusted-binary-caches’ in $Nix::Config::confDir/nix.conf)\n"
                 unless scalar(grep { $url eq $_ } @trustedUrls) > 0;
             push @urls, $url;
         }
@@ -245,7 +245,10 @@ sub getAvailableCaches {
 
     my @untrustedUrls = strToList $Nix::Config::config{"untrusted-extra-binary-caches"} // "";
     foreach my $url (@untrustedUrls) {
-        next unless scalar(grep { $url eq $_ } @trustedUrls) > 0;
+        unless (scalar(grep { $url eq $_ } @trustedUrls) > 0) {
+            warn "binary cache ‘$url’ is not trusted (please add it to ‘trusted-binary-caches’ in $Nix::Config::confDir/nix.conf)\n";
+            next;
+        }
         push @urls, $url;
     }