Skip to content

Commit 29e707a

Browse files
committed
Retry apt command once in case it was a download issue
1 parent e4c9a76 commit 29e707a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

trixie

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ function _apt_with_progress() {
248248
done
249249
}
250250

251+
_apt_retried=false
252+
251253
function _apt() {
252254
set -o pipefail
253255
cat << EOF >> "$YUNOHOST_LOG"
@@ -269,6 +271,11 @@ EOF
269271
fi
270272
fi
271273
set +o pipefail
274+
if [[ "$ret" == "1" ]] && [[ "$_apt_retried" == false ]]; then
275+
warn "Retrying apt in case this was just a transient download issue..."
276+
_apt_retried=true
277+
_apt "$@"
278+
fi
272279
return "$ret"
273280
}
274281

0 commit comments

Comments
 (0)