From 704bab8af1d7ce30a3ce5fa2dd65f7f57edfa88c Mon Sep 17 00:00:00 2001 From: BlackAngelTVdev Date: Fri, 27 Nov 2026 07:44:19 +0100 Subject: [PATCH] fix(ci): retry the dependency install on a lagging mirror pacman aborted the transaction because one mirror answered 404 for a signature file, which happens while a mirror catches up with the package database. The databases are refreshed and the install retried instead of failing the release on the first attempt. --- .gitea/workflows/package.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/package.yml b/.gitea/workflows/package.yml index 63f4ac3..0550fea 100644 --- a/.gitea/workflows/package.yml +++ b/.gitea/workflows/package.yml @@ -44,11 +44,20 @@ jobs: echo "All the build dependencies are already installed." exit 0 fi - if ! sudo -n pacman -S --needed --noconfirm $missing; then - echo "::error::could not install:$missing" - echo '::error::give the runner user passwordless sudo for pacman or preinstall these packages.' - exit 1 - fi + # A mirror can lag behind the package database and answer 404 for a + # signature that was just published, which aborts the whole + # transaction: refresh the databases and retry before giving up. + attempt=1 + until sudo -n pacman -Syy --needed --noconfirm $missing; do + if [ "$attempt" -ge 3 ]; then + echo "::error::could not install:$missing" + echo '::error::give the runner user passwordless sudo for pacman or preinstall these packages.' + exit 1 + fi + attempt=$((attempt + 1)) + echo "::warning::pacman failed, retrying ($attempt/3)" + sleep 15 + done - name: Read the version file id: version