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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Render the channel templates plus this machine's regional additions as the
|
conf=$templates/pacman-$channel.conf mirrorlist=$templates/mirrorlist-$channel
|
||||||
# caller, so root only copies finished files. The scratch directory goes on
|
# Regions render x86 pacman only (omarchy #13690).
|
||||||
# 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.
|
|
||||||
if [[ $platform == x86 ]]; then
|
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"
|
"$OMARCHY_PATH/bin/omarchy-apply-pacman" --render "$channel" "$rendered"
|
||||||
else
|
conf=$rendered/pacman.conf mirrorlist=$rendered/mirrorlist
|
||||||
cp "$templates/pacman-$channel.conf" "$rendered/pacman.conf"
|
|
||||||
cp "$templates/mirrorlist-$channel" "$rendered/mirrorlist"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo cp -f /etc/pacman.conf /etc/pacman.conf.bak
|
sudo cp -f /etc/pacman.conf /etc/pacman.conf.bak
|
||||||
sudo cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
|
sudo cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
|
||||||
echo "Setting channel to $channel"
|
echo "Setting channel to $channel"
|
||||||
sudo cp -f "$rendered/pacman.conf" /etc/pacman.conf
|
sudo cp -f "$conf" /etc/pacman.conf
|
||||||
sudo cp -f "$rendered/mirrorlist" /etc/pacman.d/mirrorlist
|
sudo cp -f "$mirrorlist" /etc/pacman.d/mirrorlist
|
||||||
rm -rf "$rendered"
|
|
||||||
|
|
||||||
# Allow user customization of /etc/pacman.conf before the upgrade runs, so
|
# Allow user customization of /etc/pacman.conf before the upgrade runs, so
|
||||||
# custom repositories and IgnorePkg entries shape the downgrade-capable
|
# custom repositories and IgnorePkg entries shape the downgrade-capable
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ fi
|
|||||||
channel=${OMARCHY_MIRROR:-}
|
channel=${OMARCHY_MIRROR:-}
|
||||||
[[ -n $channel && -f $templates/pacman-$channel.conf ]] || channel=$(omarchy_pacman_default_channel "$platform")
|
[[ -n $channel && -f $templates/pacman-$channel.conf ]] || channel=$(omarchy_pacman_default_channel "$platform")
|
||||||
# Regions render x86 pacman only (omarchy #13690).
|
# 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"
|
"$OMARCHY_PATH/bin/omarchy-apply-pacman" "$channel"
|
||||||
else
|
else
|
||||||
cp -f "$templates/pacman-$channel.conf" /etc/pacman.conf
|
cp -f "$templates/pacman-$channel.conf" /etc/pacman.conf
|
||||||
|
|||||||
Reference in new issue
Block a user