From 87ba5fdb4d3b24c232e2a949540557687c53f48d Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Sun, 8 Sep 2024 15:08:05 -0400 Subject: [PATCH] tools/distro-tool: replace wget with curl Signed-off-by: Ian Leonard --- tools/distro-tool | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/distro-tool b/tools/distro-tool index c7ccd13fc5..150eaf5f32 100755 --- a/tools/distro-tool +++ b/tools/distro-tool @@ -348,7 +348,7 @@ class MyUtility(object): raise return "" - # Use wget with same parameters as scripts/get is using + # Use same get command as scripts/get_archive is using @staticmethod def download_file(msgs, filename_data, filename_log, url): retries=10 @@ -357,10 +357,7 @@ class MyUtility(object): while attempts < retries: if stopped.is_set(): break attempts += 1 - if url.startswith("ftp:"): - (result, output) = MyUtility.runcommand(msgs, "wget --output-file=- --timeout=30 --tries=3 --no-check-certificate -O %s %s" % (filename_data, url), logfile=filename_log) - else - (result, output) = MyUtility.runcommand(msgs, "wget --output-file=- --timeout=30 --tries=3 --passive-ftp --no-check-certificate -O %s %s" % (filename_data, url), logfile=filename_log) + (result, output) = MyUtility.runcommand(msgs, f"curl --silent --show-error --connect-timeout 30 --retry 3 --continue-at - --location --max-redirs 5 --output {filename_data} {url}", logfile=filename_log) if result == 0: return True