aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xarchsetup15
1 files changed, 15 insertions, 0 deletions
diff --git a/archsetup b/archsetup
index ae87c3a..a7cce2c 100755
--- a/archsetup
+++ b/archsetup
@@ -990,6 +990,21 @@ prerequisites() {
--save /etc/pacman.d/mirrorlist
EOF
+ # Run reflector now, not only on the timer. The base image ships the full
+ # unsorted worldwide mirrorlist (hundreds of mirrors), so the heavy package
+ # installs below can stall for many minutes on a slow or unresponsive one.
+ # Curate to a few fast, recently-synced HTTPS mirrors up front, then refresh
+ # the databases against them. Bounded by `timeout` and non-fatal: reflector's
+ # own per-probe timeouts cap it, and the base list still works if it can't
+ # finish, so a flaky mirror-status service never blocks the install.
+ action="selecting fast mirrors (reflector)" && display "task" "$action"
+ backup_system_file /etc/pacman.d/mirrorlist
+ if timeout 120 reflector @/etc/xdg/reflector/reflector.conf >> "$logfile" 2>&1; then
+ pacman -Syy >> "$logfile" 2>&1 || error_warn "refreshing databases after reflector" "$?"
+ else
+ error_warn "selecting fast mirrors (reflector)" "$?"
+ fi
+
action="enabling the reflector timer" && display "task" "$action"
(systemctl enable reflector.timer >> "$logfile" 2>&1) || \
error_warn "$action" "$?"