From 29e707a0f0ee166b11f8cc20681c0d5dd9968626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 2 Nov 2025 12:37:51 +0100 Subject: [PATCH] Retry apt command once in case it was a download issue --- trixie | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/trixie b/trixie index 8e1e5d9..4a1525b 100755 --- a/trixie +++ b/trixie @@ -248,6 +248,8 @@ function _apt_with_progress() { done } +_apt_retried=false + function _apt() { set -o pipefail cat << EOF >> "$YUNOHOST_LOG" @@ -269,6 +271,11 @@ EOF fi fi set +o pipefail + if [[ "$ret" == "1" ]] && [[ "$_apt_retried" == false ]]; then + warn "Retrying apt in case this was just a transient download issue..." + _apt_retried=true + _apt "$@" + fi return "$ret" }