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.
This commit is contained in:
2 files changed
+17
-19
No files matched your search
+16
-18
@@ -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
|
||||
|
||||
Reference in new issue
Block a user