From 952bc80b4d960d65c49e5f2eb9be0415808bbc9b Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Thu, 27 May 2010 18:59:19 +0000 Subject: [PATCH] Let fetchurl retry failed downloads. Add NIX_CURL_FLAGS impure var svn path=/nixpkgs/trunk/; revision=22006 --- pkgs/build-support/fetchurl/builder.sh | 4 +++- pkgs/build-support/fetchurl/default.nix | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh index 22ba25e90a4f..1682dc63392d 100644 --- a/pkgs/build-support/fetchurl/builder.sh +++ b/pkgs/build-support/fetchurl/builder.sh @@ -13,9 +13,11 @@ fi # cryptographic hash of the output anyway). curl="curl \ --location --max-redirs 20 \ + --retry 3 --disable-epsv \ --cookie-jar cookies \ - --insecure" + --insecure \ + $NIX_CURL_OPTIONS" tryDownload() { diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index 1ba9124027d4..62f6fb2acf4b 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -91,6 +91,9 @@ stdenv.mkDerivation { # by definition pure. "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" + # This variable allows the user to pass additional options to curl + "NIX_CURL_FLAGS" + # This variable allows the user to override hashedMirrors from the # command-line. "NIX_HASHED_MIRRORS"