aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-11 11:34:22 -0500
committerCraig Jennings <c@cjennings.net>2026-06-11 11:34:22 -0500
commitc0d83a4c75ae97d64b28f291c9f007c2bcb86d6e (patch)
tree07c20760ca2701c476536b4237034e0c24c4a4d7
parent1f89523739a575f5dec19616ec44df4143df4866 (diff)
downloadarchsetup-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-xarchsetup15
1 files changed, 14 insertions, 1 deletions
diff --git a/archsetup b/archsetup
index 13ee7a0..3f4821f 100755
--- a/archsetup
+++ b/archsetup
@@ -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"