Pin Terra on a server that already has it, before its package update

This commit is contained in:
Gabriel Brown committed 2026-10-30 14:19:14 -04:00
1 parent c6fb2fa767
commit 5af5d7a96b
2 files changed
+21

No files matched your search

+12
View File
@@ -1318,6 +1318,18 @@ fi
if [[ "$ROLE" == server ]]; then
echo -e "\n--- Installing packages (server) ---"
# A server never installs Terra, but one that already has it (installed by
# hand, or by an older Panama) has it enabled for the update below. Pin it
# first, exactly as a desktop would, rather than update through a stock
# terra-release file with metadata checks off.
if rpm -q terra-release >/dev/null 2>&1; then
terra_status=0
_terra_effective_status || terra_status=$?
if (( terra_status != 1 )); then
log "Pinning the Terra repository this server already has"
install_terra_repository > /dev/null
fi
fi
log "Updating all packages. This may take a while"
sudo dnf update -y --refresh > /dev/null
install_list core-packages "Core"
+9
View File
@@ -90,6 +90,15 @@ PY
sed -n '/^if \[\[ "\$ROLE" == server \]\]; then/,/^fi/p' "$installer" | grep -q '^\s*exit 0' \
|| note 'the server branch does not exit before the desktop section'
# A server pins a Terra it already has, but never installs one: the Terra call
# in the server branch must sit behind the terra-release check.
server_branch="$(sed -n '/^if \[\[ "\$ROLE" == server \]\]; then/,/^fi/p' "$installer")"
if grep -q 'install_terra_repository' <<<"$server_branch"; then
awk '/rpm -q terra-release/ { guarded = 1 } /install_terra_repository/ && !guarded { bad = 1 }
END { exit bad }' <<<"$server_branch" \
|| note 'the server branch can install Terra on a server that never had it'
fi
# ── Everything fragile is actually tolerated ────────────────────────────────
#
# Being below the desktop is only half of it. A bare `dnf swap` below the