From 9c21322c01e84d8a1301f1ca21d8187d9bcdfa77 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 14 Jan 2026 23:36:12 +0100 Subject: [PATCH] Rerun apt-get if it failed We often get errors due to repositories being updated, so retry running apt when this happens to see if it helps. --- scripts/ci/common.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ci/common.sh b/scripts/ci/common.sh index cb50dc88..82f77e09 100644 --- a/scripts/ci/common.sh +++ b/scripts/ci/common.sh @@ -96,12 +96,16 @@ tmstamp() echo -n "[$(date '+%H:%M:%S')]" ; } +# Disable some (but not all) output. SOCI_APT_OPTIONS='-q -y -o=Dpkg::Use-Pty=0 --no-install-recommends' run_apt() { - # Disable some (but not all) output. - sudo apt-get $SOCI_APT_OPTIONS "$@" + if ! sudo apt-get $SOCI_APT_OPTIONS "$@"; then + echo "apt-get "$@" failed, retrying once just in case it was spurious..." + sleep 30 + sudo apt-get $SOCI_APT_OPTIONS "$@" + fi } run_make()