From c0c490271347d1d5d0e75ed4806140882482d0f5 Mon Sep 17 00:00:00 2001 From: Joerg Behrmann Date: Mon, 11 Sep 2023 15:03:33 +0200 Subject: [PATCH] tools: add ToolsTreePackages= 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 | 2 +- mkosi/config.py | 8 ++++++++ mkosi/resources/mkosi.md | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 502ce1a12..c686902fd 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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", "", diff --git a/mkosi/config.py b/mkosi/config.py index 57d480d24..1da591e02 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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 = ( diff --git a/mkosi/resources/mkosi.md b/mkosi/resources/mkosi.md index f35a9d84d..49f2cc78a 100644 --- a/mkosi/resources/mkosi.md +++ b/mkosi/resources/mkosi.md @@ -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 -- 2.47.2