Install every pinned local build so a later switch to China finds rime-ice-installer

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 21:14:50 -04:00
1 parent 0d8d95a340
commit 22f0b5acfb
2 files changed
+34

No files matched your search

@@ -746,6 +746,9 @@ def _runtime_package_list(ctx: InstallContext) -> list[str]:
continue
if s not in already_installed and s not in pkgs:
pkgs.append(s)
# Local builds live only in this ISO's mirror; a later region switch could not fetch them.
if PINNED_PACKAGES.exists():
pkgs += [p for p in PINNED_PACKAGES.read_text().split() if p not in already_installed and p not in pkgs]
return pkgs
+31
View File
@@ -83,5 +83,36 @@ class PinLocalPackagesTest(unittest.TestCase):
self.assertFalse((root / "etc/pacman.d").exists())
class RuntimePackagesTest(unittest.TestCase):
def runtime_packages(self, pinned: str | None) -> list[str]:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
pinned_file = root / "pinned-packages"
if pinned is not None:
pinned_file.write_text(pinned)
base = root / "omarchy-base.packages"
base.write_text("# base\nfcitx5\ngit\n")
real_path = phases_impl.Path
def path(arg, *rest):
if arg == "/usr/share/omarchy-iso/omarchy-base.packages":
return base
return real_path(arg, *rest)
with mock.patch.object(phases_impl, "PINNED_PACKAGES", pinned_file), \
mock.patch.object(phases_impl, "Path", side_effect=path), \
mock.patch.object(phases_impl, "_early_packages", return_value=["git"]), \
mock.patch.object(phases_impl, "_package_targets", return_value={
"runtime": "omarchy-dev", "settings": "omarchy-settings-dev", "nvim": "omarchy-nvim"}):
return phases_impl._runtime_package_list(types.SimpleNamespace())
def test_local_builds_install_on_every_region(self):
packages = self.runtime_packages("omarchy-dev\nomarchy-settings-dev\nrime-ice-installer\n")
self.assertEqual(packages, ["omarchy-dev", "fcitx5", "rime-ice-installer"])
def test_published_builds_add_nothing(self):
self.assertEqual(self.runtime_packages(None), ["omarchy-dev", "fcitx5"])
if __name__ == "__main__":
unittest.main()