]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Don't allow configuring distribution, release and mirror in tools tree config 3641/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 1 Apr 2025 18:37:52 +0000 (20:37 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 1 Apr 2025 18:56:59 +0000 (20:56 +0200)
config_default_repository_key_check() depends on ToolsTreeDistribution=
to select the right default. If the tools tree distribution is configured
in mkosi.tools.conf, we're unable to select the right default for
RepositoryKeyCheck= for the main image. Until we figure out a decent solution
for this, let's insist that the tools tree distribution is configured via
ToolsTreeDistribution=.

Similarly, selecting the default tools tree mirror depends on the selected
target distribution and mirror, so we insist on configuring the tools tree
mirror and release via ToolsTreeMirror= and ToolsTreeRelease= for now.

mkosi/config.py
tests/test_config.py

index 0116e625be15fd517f48b1388171b5f77c27419e..3106dd5d4afddde68d9f17a0b002e984d82df5b9 100644 (file)
@@ -2563,7 +2563,6 @@ SETTINGS: list[ConfigSetting[Any]] = [
         choices=Distribution.choices(),
         help="Distribution to install",
         scope=SettingScope.universal,
-        tools=True,
     ),
     ConfigSetting(
         dest="release",
@@ -2576,7 +2575,6 @@ SETTINGS: list[ConfigSetting[Any]] = [
         default_factory_depends=("distribution",),
         help="Distribution release to install",
         scope=SettingScope.universal,
-        tools=True,
     ),
     ConfigSetting(
         dest="architecture",
@@ -2595,7 +2593,6 @@ SETTINGS: list[ConfigSetting[Any]] = [
         section="Distribution",
         help="Distribution mirror to use",
         scope=SettingScope.universal,
-        tools=True,
     ),
     ConfigSetting(
         dest="local_mirror",
index 2c262137505f5f3a4371680bcba12320a38c1cab..e071d0ff0b23344fa629f4f8ad243f52702479e3 100644 (file)
@@ -1429,9 +1429,6 @@ def test_tools(tmp_path: Path) -> None:
 
         (d / "mkosi.tools.conf").write_text(
             f"""
-            [Distribution]
-            Distribution=debian
-
             [Content]
             PackageDirectories={d}
             """
@@ -1439,7 +1436,6 @@ def test_tools(tmp_path: Path) -> None:
 
         _, tools, _ = parse_config(argv, resources=resources)
         assert tools
-        assert tools.distribution == Distribution.debian
         assert tools.package_directories == [Path(d)]
 
         _, tools, _ = parse_config(
@@ -1463,4 +1459,4 @@ def test_tools(tmp_path: Path) -> None:
 
         _, tools, _ = parse_config(argv, resources=resources)
         assert tools
-        assert tools.distribution == Distribution.debian
+        assert tools.distribution == Distribution.arch