From b4de1c0d34b8f96af84a8fbfc64e0800aeee8712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 12 Oct 2026 00:45:43 -0400 Subject: [PATCH] Render x86 pacman through #13690 on refresh, and on install only with a region Integration only, until omarchy #13690 rebases onto the ARM pacman templates. pacman-templates-test still expects x86 refresh to copy the templates directly. --- bin/omarchy-refresh-pacman | 34 ++++++++++++++++------------------ install/post-install/pacman.sh | 2 +- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/bin/omarchy-refresh-pacman b/bin/omarchy-refresh-pacman index 338ff699..37bc3922 100755 --- a/bin/omarchy-refresh-pacman +++ b/bin/omarchy-refresh-pacman @@ -42,31 +42,29 @@ if [[ ! -f $templates/pacman-$channel.conf || ! -f $templates/mirrorlist-$channe exit 1 fi -# Render the channel templates plus this machine's regional additions as the -# caller, so root only copies finished files. The scratch directory goes on -# every exit, including a failed render, a refused sudo prompt, or a signal; -# revoking the sudo timestamp stays the last thing the exit path does. -rendered=$(mktemp -d) -cleanup_refresh() { - local status=$? - rm -rf "$rendered" - omarchy_security_exit_with_revoked_sudo "$status" -} -trap cleanup_refresh EXIT -# Regions render x86 pacman only (omarchy #13690); other platforms copy their templates. +conf=$templates/pacman-$channel.conf mirrorlist=$templates/mirrorlist-$channel +# Regions render x86 pacman only (omarchy #13690). if [[ $platform == x86 ]]; then + # Render the channel templates plus this machine's regional additions as the + # caller, so root only copies finished files. The scratch directory goes on + # every exit, including a failed render, a refused sudo prompt, or a signal; + # revoking the sudo timestamp stays the last thing the exit path does. + rendered=$(mktemp -d) + cleanup_refresh() { + local status=$? + rm -rf "$rendered" + omarchy_security_exit_with_revoked_sudo "$status" + } + trap cleanup_refresh EXIT "$OMARCHY_PATH/bin/omarchy-apply-pacman" --render "$channel" "$rendered" -else - cp "$templates/pacman-$channel.conf" "$rendered/pacman.conf" - cp "$templates/mirrorlist-$channel" "$rendered/mirrorlist" + conf=$rendered/pacman.conf mirrorlist=$rendered/mirrorlist fi sudo cp -f /etc/pacman.conf /etc/pacman.conf.bak sudo cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak echo "Setting channel to $channel" -sudo cp -f "$rendered/pacman.conf" /etc/pacman.conf -sudo cp -f "$rendered/mirrorlist" /etc/pacman.d/mirrorlist -rm -rf "$rendered" +sudo cp -f "$conf" /etc/pacman.conf +sudo cp -f "$mirrorlist" /etc/pacman.d/mirrorlist # Allow user customization of /etc/pacman.conf before the upgrade runs, so # custom repositories and IgnorePkg entries shape the downgrade-capable diff --git a/install/post-install/pacman.sh b/install/post-install/pacman.sh index acf86d14..690961fe 100644 --- a/install/post-install/pacman.sh +++ b/install/post-install/pacman.sh @@ -22,7 +22,7 @@ fi channel=${OMARCHY_MIRROR:-} [[ -n $channel && -f $templates/pacman-$channel.conf ]] || channel=$(omarchy_pacman_default_channel "$platform") # Regions render x86 pacman only (omarchy #13690). -if [[ $platform == x86 ]]; then +if [[ $platform == x86 && -e /etc/omarchy/region ]]; then "$OMARCHY_PATH/bin/omarchy-apply-pacman" "$channel" else cp -f "$templates/pacman-$channel.conf" /etc/pacman.conf