From 2d3fe1d216a7c7ee0347d6a1675c56b362f9d162 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 17 Sep 2021 14:57:57 +0200 Subject: [download] manual retry loop instead of --retry on some specific errors, curl just ignores --retry and just instantly fail. The new curl option '--retry-all-errors' is only supported starting with version 7.71.0 which is not yet in Ubuntu 20.04. We should probably change to that new option when the base system supports it. --- modules/download.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/download.inc b/modules/download.inc index 5191922..1b5d67c 100644 --- a/modules/download.inc +++ b/modules/download.inc @@ -5,6 +5,14 @@ download() { } download_retry() { - download --retry 3 --retry-max-time 12 "$@" + for delay in {1..3} ""; do + if download --retry-max-time 12 "$@"; then + return 0 + fi + if [ -n "$delay" ]; then + sleep "$delay" + fi + done + return 1 } -- cgit v1.2.3-55-g7522