diff -ru nix-1.11.7/scripts/download-from-binary-cache.pl.in nix-1.11.7-new/scripts/download-from-binary-cache.pl.in
--- nix-1.11.7/scripts/download-from-binary-cache.pl.in 1970-01-01 00:00:01.000000000 +0000
+++ nix-1.11.7-new/scripts/download-from-binary-cache.pl.in 2017-03-16 22:54:37.938616657 +0000
@@ -86,6 +86,7 @@
$curl->setopt(CURLOPT_USERAGENT, $userAgent);
$curl->setopt(CURLOPT_NOBODY, 1) if $head;
$curl->setopt(CURLOPT_FAILONERROR, 1);
+ $curl->setopt(CURLOPT_NETRC, 1);
$curl->setopt(CURLOPT_CONNECTTIMEOUT, $curlConnectTimeout);
$curl->setopt(CURLOPT_TIMEOUT, 20 * 60);
@@ -563,7 +564,7 @@
die if $requireSignedBinaryCaches && !defined $info->{signedBy};
print STDERR "\n*** Downloading ‘$url’ ", ($requireSignedBinaryCaches ? "(signed by ‘$info->{signedBy}’) " : ""), "to ‘$storePath’...\n";
checkURL $url;
- if (system("$Nix::Config::curl --fail --location --connect-timeout $curlConnectTimeout -A '$userAgent' $Nix::Config::curlCaFlag '$url' $decompressor | $Nix::Config::binDir/nix-store --restore $destPath") != 0) {
+ if (system("$Nix::Config::curl -n --fail --location --connect-timeout $curlConnectTimeout -A '$userAgent' $Nix::Config::curlCaFlag '$url' $decompressor | $Nix::Config::binDir/nix-store --restore $destPath") != 0) {
warn "download of ‘$url’ failed" . ($! ? ": $!" : "") . "\n";
next;
}