From 5c0984331a35926996ae6c2837eb177797bdc1cc Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Apr 2024 19:41:38 +0000 Subject: [PATCH] _dl.sh: show error when source / signature download failed [ci skip] --- _dl.sh | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/_dl.sh b/_dl.sh index 721c3a2b2..df1e6ea4a 100755 --- a/_dl.sh +++ b/_dl.sh @@ -563,18 +563,26 @@ live_dl() { options+=(--output pkg.sig "${sig}") fi set -x - if ! my_curl "${options[@]}" && [ -n "${mirror}" ]; then - options=() - if [[ "${mirror}" = 'https://github.com/'* ]]; then - options+=(--location --proto-redir '=https') - fi - options+=(--output pkg.bin "${mirror}") - sig="${sigraw}" - if [ -n "${sig}" ]; then - [[ "${sig}" = 'https://'* ]] || sig="${mirror}${sig}" - options+=(--output pkg.sig "${sig}") + if ! my_curl "${options[@]}"; then + if [ -n "${mirror}" ]; then + options=() + if [[ "${mirror}" = 'https://github.com/'* ]]; then + options+=(--location --proto-redir '=https') + fi + options+=(--output pkg.bin "${mirror}") + sig="${sigraw}" + if [ -n "${sig}" ]; then + [[ "${sig}" = 'https://'* ]] || sig="${mirror}${sig}" + options+=(--output pkg.sig "${sig}") + fi + if ! my_curl "${options[@]}"; then + >&2 echo "! ${name}: Download: Failed (from mirror)" + exit 1 + fi + else + >&2 echo "! ${name}: Download: Failed" + exit 1 fi - my_curl "${options[@]}" fi if [ -n "${sig}" ]; then