From 1dbe97d9b7072c56f466dc542daf71289ee016fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 12 Oct 2026 01:17:59 -0400 Subject: [PATCH] Refuse the China region off x86 until #13690 renders ARM pacman Integration only. --- bin/omarchy-region | 6 ++++++ plans/omarchycn.md | 2 +- test/shell.d/region-switch-test.sh | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-region b/bin/omarchy-region index f01a9f8a..10dc761f 100755 --- a/bin/omarchy-region +++ b/bin/omarchy-region @@ -32,6 +32,12 @@ if [[ $channel != "stable" && $channel != "rc" && $channel != "edge" ]]; then exit 1 fi +# The cn profile renders x86 pacman only (omarchy #13690). +if [[ $1 == "cn" && $(omarchy-hw-platform) != "x86" ]]; then + echo "The China region needs an x86 machine; $(omarchy-hw-platform) has no China profile yet" >&2 + exit 1 +fi + if [[ $1 == "cn" ]]; then # Upgrade first: the keyring install below syncs new databases. omarchy-update-pacman -Syu --noconfirm diff --git a/plans/omarchycn.md b/plans/omarchycn.md index 441819d5..b93deaa9 100644 --- a/plans/omarchycn.md +++ b/plans/omarchycn.md @@ -43,7 +43,7 @@ omarchy, each a fork branch: - `cn-developer-mirrors` on #13690: the `cn` developer mirrors at install. - `cn-region-switch` on `cn-developer-mirrors`: `omarchy region`, Setup > Region, China Apps, `manual/52-china.md`; English only. -`omarchycn` merges them onto `quattro` and adds what no PR can carry yet: the Chinese wording for Region and China Apps and the language half of the China manual (needs both language and region), and an integration-only pacman resolution until #13690 rebases onto upstream's ARM templates. Known failure there: `pacman-templates-test` expects x86 refresh to copy templates directly, which #13690 replaces with a render. +`omarchycn` merges them onto `quattro` and adds what no PR can carry yet: the Chinese wording for Region and China Apps and the language half of the China manual (needs both language and region), and, until #13690 rebases onto upstream's ARM templates, an integration-only pacman resolution and a guard that refuses `omarchy region cn` off x86. Known failure there: `pacman-templates-test` expects x86 refresh to copy templates directly, which #13690 replaces with a render. ## Tasks diff --git a/test/shell.d/region-switch-test.sh b/test/shell.d/region-switch-test.sh index 73f436b8..5b084096 100644 --- a/test/shell.d/region-switch-test.sh +++ b/test/shell.d/region-switch-test.sh @@ -20,6 +20,7 @@ for command in omarchy-refresh-pacman omarchy-system-logout pacman-key pacman om done printf '#!/bin/bash\necho "omarchy-update-pacman $*" >>"%s"\n[[ -z ${STUB_UPDATE_FAIL:-} ]]\n' "$calls" >"$test_tmp/bin/omarchy-update-pacman" printf '#!/bin/bash\necho "${STUB_CHANNEL:-stable}"\n' >"$test_tmp/bin/omarchy-version-channel" +printf '#!/bin/bash\necho "${STUB_PLATFORM:-x86}"\n' >"$test_tmp/bin/omarchy-hw-platform" printf '#!/bin/bash\n[[ $1 == env ]] && shift\nexec env "$@"\n' >"$test_tmp/bin/sudo" printf '#!/bin/bash\necho "gum $*" >>"%s"\nexit "${GUM_ANSWER:-1}"\n' "$calls" >"$test_tmp/bin/gum" chmod +x "$test_tmp/bin"/* @@ -58,6 +59,13 @@ fi [[ $(omarchy-region) == "Global" ]] || fail "a refused switch changes nothing" pass "an unknown region or an unclear channel is refused" +: >"$calls" +if output=$(STUB_PLATFORM=aarch64-apple omarchy-region cn 2>&1); then + fail "an ARM machine refuses the China region" "$output" +fi +[[ $(omarchy-region) == "Global" && ! -s $calls ]] || fail "a refused ARM switch changes nothing" "$(<"$calls")" +pass "an ARM machine refuses the China region before changing anything" + : >"$calls" if output=$(STUB_UPDATE_FAIL=1 omarchy-region cn 2>&1); then fail "switching to China fails when the upgrade fails" "$output"