🐛 fix(build): require regional user defaults
- 🛡️ fail a regional build whose profile lacks `skel`, instead of shipping an ISO that silently skips the advertised input defaults Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
422d898033
commit
55d5f831d4
2 files changed
+10
-1
No files matched your search
@@ -17,7 +17,8 @@ esac
|
||||
|
||||
profile="$runtime/default/regions/$region"
|
||||
if [[ ! -f $runtime/bin/omarchy-apply-pacman || ! -f $profile/packages ||
|
||||
! -f $profile/pacman/pacman.conf.append || ! -f $profile/pacman/mirrorlist.append ]]; then
|
||||
! -f $profile/pacman/pacman.conf.append || ! -f $profile/pacman/mirrorlist.append ||
|
||||
! -d $profile/skel ]]; then
|
||||
echo "Runtime does not support region '$region'; publish a matching runtime or use --local-source." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -93,6 +93,7 @@ class RegionBuildTest(unittest.TestCase):
|
||||
self.profile = self.runtime / "default/regions/cn"
|
||||
(self.profile / "pacman").mkdir(parents=True)
|
||||
(self.runtime / "bin").mkdir()
|
||||
(self.profile / "skel").mkdir()
|
||||
(self.runtime / "bin/omarchy-apply-pacman").touch()
|
||||
(self.profile / "packages").write_text("archlinuxcn-keyring\nfcitx5-rime\n")
|
||||
(self.profile / "pacman/pacman.conf.append").write_text("[archlinuxcn]\nServer = https://mirrors.ustc.edu.cn/archlinuxcn/$arch\n")
|
||||
@@ -148,6 +149,13 @@ class RegionBuildTest(unittest.TestCase):
|
||||
self.assertFalse(self.log.exists())
|
||||
self.assertEqual(self.config.read_bytes(), self.original_config)
|
||||
|
||||
def test_profile_without_user_defaults_fails_before_package_operations(self):
|
||||
(self.profile / "skel").rmdir()
|
||||
result = self.prepare("cn")
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertFalse(self.log.exists())
|
||||
self.assertEqual(self.packages.read_text(), "base\n")
|
||||
|
||||
def test_untrusted_keyring_aborts_without_importing_keys(self):
|
||||
result = self.prepare("cn", TEST_PACMAN_STATUS="1")
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
|
||||
Reference in new issue
Block a user