Document and test the [omarchy] mirror wiring
Static suite assertions pin the stable conf's server order and keep edge/rc upstream-only; the guard test proves exact-line semantics. docs/pacman-repo.md gains the mirror section with the honest operational contract: staleness is invisible to pacman, fallback fires only on retrieval failure, and omarchy-refresh-pacman's -Syyuu downgrade wipes the cn layer while upstream ships older omarchy-dev. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019hLK3wsDuKVAC37GgDqg6H
This commit is contained in:
@@ -80,6 +80,35 @@ if missing or not weak_appends:
|
||||
PYEOF
|
||||
pass "fontconfig priority file carries SC/JP/KR rules and weak fallback"
|
||||
|
||||
# [omarchy] mirror wiring: stable is mirror-first with upstream fallback
|
||||
mapfile -t stable_servers < <(sed -n '/^\[omarchy\]/,$p' "$ROOT/default/pacman/pacman-stable.conf" | grep '^Server = ')
|
||||
[[ ${stable_servers[0]:-} == "Server = https://git.zacharyzhang.com/api/packages/ZacharyZhang-NY/arch/omarchy/x86_64" ]] ||
|
||||
fail "stable conf lists the OmarchyCN mirror first" "${stable_servers[0]:-none}"
|
||||
[[ ${stable_servers[1]:-} == 'Server = https://pkgs.omarchy.org/stable/$arch' ]] ||
|
||||
fail "stable conf keeps the upstream fallback second" "${stable_servers[1]:-none}"
|
||||
for ch in edge rc; do
|
||||
if grep -q git.zacharyzhang.com "$ROOT/default/pacman/pacman-$ch.conf"; then
|
||||
fail "$ch conf must stay upstream-only (mirror carries stable only)"
|
||||
fi
|
||||
done
|
||||
bash -n "$ROOT/cn/migrations/1787861071.sh" || fail "mirror migration parses"
|
||||
grep -q "pacman-key --add" "$ROOT/install/post-install/pacman.sh" || fail "install imports the registry key"
|
||||
pass "[omarchy] mirror wiring: stable mirror-first, edge/rc untouched, key import present"
|
||||
|
||||
# Mirror-line guard: comments and substrings must not count as present
|
||||
tmpconf=$(mktemp)
|
||||
printf 'Server = https://pkgs.omarchy.org/stable/$arch\n' > "$tmpconf"
|
||||
(
|
||||
source "$ROOT/cn/lib/mirror.sh"
|
||||
OMARCHYCN_PACMAN_CONF=$tmpconf cn_mirror_omarchy_repo_ok && exit 1
|
||||
printf '# Server = %s\n' "$CN_OMARCHY_MIRROR" >> "$tmpconf"
|
||||
OMARCHYCN_PACMAN_CONF=$tmpconf cn_mirror_omarchy_repo_ok && exit 1
|
||||
printf 'Server = %s\n' "$CN_OMARCHY_MIRROR" >> "$tmpconf"
|
||||
OMARCHYCN_PACMAN_CONF=$tmpconf cn_mirror_omarchy_repo_ok
|
||||
) || fail "omarchy repo guard exact-line semantics"
|
||||
rm -f "$tmpconf"
|
||||
pass "omarchy mirror guard ignores comments and matches only the exact line"
|
||||
|
||||
# Menu: OmarchyCN entries parse and reference only existing commands
|
||||
node -e '
|
||||
const fs = require("fs");
|
||||
|
||||
Reference in New Issue
Block a user