]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
tools: add ToolsTreePackages= 1893/head
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 11 Sep 2023 13:03:33 +0000 (15:03 +0200)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 11 Sep 2023 13:03:33 +0000 (15:03 +0200)
Since we are defaulting to testing for Debian tools trees, we will always fight
testing being occasionally broken, e.g. when packages disappear because their
newer versions can't transition from unstable.

ToolsTreePackages= adds the ability to keep using a default tools tree, but add
custom packages on top.

mkosi/__init__.py
mkosi/config.py
mkosi/resources/mkosi.md

index 502ce1a12b4afb629ab9e02b71015cde4d694e0c..c686902fd3b99b11d092674c972f460d951f0765 100644 (file)
@@ -2179,7 +2179,7 @@ def finalize_tools(args: MkosiArgs, presets: Sequence[MkosiConfig]) -> Sequence[
             "--incremental", str(p.incremental),
             "--acl", str(p.acl),
             "--format", "directory",
-            *flatten(["--package", package] for package in distribution.tools_tree_packages()),
+            *flatten(["--package", package] for package in itertools.chain(distribution.tools_tree_packages(), p.tools_tree_packages)),
             "--output", f"{distribution}-tools",
             "--bootable", "no",
             "--manifest-format", "",
index 57d480d2470d891db0c7d21556dcaf21b8874189..1da591e02a73319c0c0b720420fa6f64ef61a69c 100644 (file)
@@ -714,6 +714,7 @@ class MkosiConfig:
     tools_tree: Optional[Path]
     tools_tree_distribution: Optional[Distribution]
     tools_tree_release: Optional[str]
+    tools_tree_packages: list[str]
 
     # QEMU-specific options
     qemu_gui: bool
@@ -1658,6 +1659,13 @@ SETTINGS = (
         parse=config_parse_string,
         help="Set the release to use for the default tools tree",
     ),
+    MkosiConfigSetting(
+        dest="tools_tree_packages",
+        metavar="PACKAGE",
+        section="Host",
+        parse=config_make_list_parser(delimiter=","),
+        help="Add additional packages to the tools tree",
+    ),
 )
 
 MATCHES = (
index f35a9d84dccb60ecf861c4fc33787016093c584c..49f2cc78ac669bbc1edd174e7e7d31eec392af8d 100644 (file)
@@ -1150,6 +1150,12 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
   default, the hardcoded default release in mkosi for the distribution
   is used.
 
+`ToolsTreePackages=`, `--tools-tree-packages=`
+
+: Extra packages to install into the tools tree. Takes a comma separated list
+  of package specifications. This option may be used multiple times in which
+  case the specified package lists are combined.
+
 ## Supported distributions
 
 Images may be created containing installations of the following