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