diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-11 11:34:22 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-11 11:34:22 -0500 |
| commit | c0d83a4c75ae97d64b28f291c9f007c2bcb86d6e (patch) | |
| tree | 07c20760ca2701c476536b4237034e0c24c4a4d7 | |
| parent | 1f89523739a575f5dec19616ec44df4143df4866 (diff) | |
| download | archsetup-c0d83a4c75ae97d64b28f291c9f007c2bcb86d6e.tar.gz archsetup-c0d83a4c75ae97d64b28f291c9f007c2bcb86d6e.zip | |
fix(install): retry the bulk package-cache refresh
A single slow mirror (fastly, <1 byte/sec on one signature file) halted a full install at the -Syu step, which had no retry while every per-package install gets three attempts. The refresh now shares MAX_INSTALL_RETRIES; pacman resumes partial downloads, so a transient stall recovers.
| -rwxr-xr-x | archsetup | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -851,8 +851,21 @@ prerequisites() { (pacman-key --populate archlinux >> "$logfile" 2>&1) || \ error_fatal "verifying Arch Linux keys" "$?" + # The bulk refresh gets the same retry budget as per-package installs — + # a single slow mirror ("Operation too slow") halted a full install at + # this step on 2026-06-11. pacman picks up where it left off on retry, + # so transient mirror stalls recover instead of killing the run. action="refreshing the package cache" && display "task" "$action" - (pacman -Syu --noconfirm >> "$logfile" 2>&1) || error_fatal "$action" "$?" + refresh_ok=false + for attempt in $(seq 1 "$MAX_INSTALL_RETRIES"); do + if pacman -Syu --noconfirm >> "$logfile" 2>&1; then + refresh_ok=true + break + fi + [ "$attempt" -lt "$MAX_INSTALL_RETRIES" ] && \ + display "task" "retrying package cache refresh (attempt $((attempt + 1))/$MAX_INSTALL_RETRIES)" + done + $refresh_ok || error_fatal "$action" "$?" display "subtitle" "Required Software" |
