From fb9c17c8d43c6e08b9858ca477230cd367db33a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Tue, 8 Sep 2015 09:40:22 +0200 Subject: [PATCH] Allow curl to follow redirects. download.opensuse.org uses redirects to point to the relevant mirror. Adding -L --max-redirs 5 to curl options will get us the requested images. --- builder/downloader.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/downloader.ml b/builder/downloader.ml index 30ca21270..46581cbd6 100644 --- a/builder/downloader.ml +++ b/builder/downloader.ml @@ -94,7 +94,7 @@ and download_to t ?(progress_bar = false) ~proxy uri filename = | _ as protocol -> (* Any other protocol. *) let outenv = proxy_envvar protocol proxy in (* Get the status code first to ensure the file exists. *) - let cmd = sprintf "%s%s%s -g -o /dev/null -I -w '%%{http_code}' %s" + let cmd = sprintf "%s%s%s -L --max-redirs 5 -g -o /dev/null -I -w '%%{http_code}' %s" outenv t.curl (if verbose () then "" else " -s -S") @@ -114,7 +114,7 @@ and download_to t ?(progress_bar = false) ~proxy uri filename = error (f_"failed to download %s: HTTP status code %s") uri status_code; (* Now download the file. *) - let cmd = sprintf "%s%s%s -g -o %s %s" + let cmd = sprintf "%s%s%s -L --max-redirs 5 -g -o %s %s" outenv t.curl (if verbose () then "" else if progress_bar then " -#" else " -s -S")