Rebuild .cn twins per server and leave database syncs to omarchy update
This commit is contained in:
1 parent
5f6c803b21
commit
07d5f49963
2 files changed
+14
-11
No files matched your search
@@ -33,8 +33,8 @@ omarchy-region china >/dev/null
|
||||
[[ $(<"$root/etc/pacman.conf") == "$china_conf" && $(<"$root/etc/pacman.d/mirrorlist") == "$china_mirrors" ]] ||
|
||||
fail "switching to China lists the .cn mirrors first"
|
||||
[[ $(omarchy-region) == "China" && $(<"$root/etc/locale.conf") == "LANG=zh_CN.UTF-8" ]] || fail "switching to China records it and sets the language"
|
||||
[[ $(<"$calls") == $'pacman -Sy\nomarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer\nlocale-gen \nrime-ice-installer --yes' ]] ||
|
||||
fail "China syncs the .cn databases before installing Rime, then sets Rime Ice up" "$(<"$calls")"
|
||||
[[ $(<"$calls") == $'omarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer\nlocale-gen \nrime-ice-installer --yes' ]] ||
|
||||
fail "China installs Rime without a partial database sync, then sets Rime Ice up" "$(<"$calls")"
|
||||
pass "switching to China sets mirrors, language and Rime Ice"
|
||||
|
||||
: >"$calls"
|
||||
@@ -45,12 +45,20 @@ omarchy-region china >/dev/null
|
||||
grep -q '^rime-ice-installer' "$calls" && fail "an existing Rime Ice setup is not redone"
|
||||
pass "switching to China again changes nothing it already did"
|
||||
|
||||
printf 'Server = https://stable-mirror.omarchy.cn/$repo/os/$arch\nServer = https://stable-mirror.omarchy.org/$repo/os/$arch\nServer = https://mirror.omarchy.org/$repo/os/$arch\n' >"$root/etc/pacman.d/mirrorlist"
|
||||
omarchy-region china >/dev/null
|
||||
[[ $(<"$root/etc/pacman.d/mirrorlist") == $'Server = https://stable-mirror.omarchy.cn/$repo/os/$arch\nServer = https://stable-mirror.omarchy.org/$repo/os/$arch\nServer = https://mirror.omarchy.cn/$repo/os/$arch\nServer = https://mirror.omarchy.org/$repo/os/$arch' ]] ||
|
||||
fail "a partly switched mirrorlist gets every missing .cn twin" "$(<"$root/etc/pacman.d/mirrorlist")"
|
||||
cp "$ROOT/default/pacman/mirrorlist-stable" "$root/etc/pacman.d/mirrorlist"
|
||||
sed -i -f "$ROOT/default/region/china/pacman.sed" "$root/etc/pacman.d/mirrorlist"
|
||||
pass "every .org server ends up with exactly one .cn twin in front"
|
||||
|
||||
: >"$calls"
|
||||
omarchy-region global >/dev/null
|
||||
[[ $(<"$root/etc/pacman.conf") == "$(<"$ROOT/default/pacman/pacman-stable.conf")" && $(<"$root/etc/pacman.d/mirrorlist") == "$(<"$ROOT/default/pacman/mirrorlist-stable")" ]] ||
|
||||
fail "switching to Global drops exactly the .cn mirrors"
|
||||
[[ $(omarchy-region) == "Global" && $(<"$root/etc/locale.conf") == "LANG=en_US.UTF-8" ]] || fail "switching to Global records it and restores English"
|
||||
[[ $(<"$calls") == $'pacman -Sy\nomarchy-setup-claude-api --remove' ]] || fail "Global removes the Claude Code third-party API and keeps Rime" "$(<"$calls")"
|
||||
[[ $(<"$calls") == "omarchy-setup-claude-api --remove" ]] || fail "Global removes the Claude Code third-party API and keeps Rime" "$(<"$calls")"
|
||||
[[ -f $HOME/.local/share/fcitx5/rime/rime_ice.schema.yaml ]] || fail "Global keeps the input method"
|
||||
pass "switching to Global restores mirrors and language, keeps Rime, removes the Claude API setup"
|
||||
|
||||
|
||||
Reference in new issue
Block a user