From 3544261e8c69db92cd9973d18707b7d7ad459260 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 22 Jul 2026 21:33:15 -0700 Subject: [PATCH] Retry stale offline package downloads --- builder/build-iso.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/builder/build-iso.sh b/builder/build-iso.sh index 6206316..57a339c 100755 --- a/builder/build-iso.sh +++ b/builder/build-iso.sh @@ -170,8 +170,19 @@ if [[ -n ${LOCAL_OMARCHY_BUILD:-} ]]; then fi mkdir -p /tmp/offlinedb -pacman --config /configs/pacman-online-${OMARCHY_MIRROR}.conf --noconfirm -Syw \ - "${all_packages[@]}" --cachedir "$offline_mirror_dir/" --dbpath /tmp/offlinedb --needed +download_offline_packages() { + pacman --config /configs/pacman-online-${OMARCHY_MIRROR}.conf --noconfirm -Syw \ + "${all_packages[@]}" --cachedir "$offline_mirror_dir/" --dbpath /tmp/offlinedb --needed +} + +# A repository may occasionally republish a package without changing its +# filename. Pacman detects that the persistent cached copy no longer matches +# the refreshed repository checksum and deletes it, but still fails the +# transaction. Retry once so the now-missing package is downloaded. +if ! download_offline_packages; then + echo "Offline package download failed; retrying after pacman cleaned invalid cached files..." >&2 + download_offline_packages +fi prune_stale_package_versions() { local dir="$1"