From 42f668d96911e9bcac4c7e24c9fd9b0d5731e238 Mon Sep 17 00:00:00 2001 From: Ozan Unsal Date: Tue, 4 Jan 2022 12:00:24 +0100 Subject: [PATCH] buildinstall: Add ability to install extra packages in runroot Resolves: https://pagure.io/pungi/issue/1461 Merges: https://pagure.io/pungi/pull-request/1580 JIRA: RHELCMP-2911 Signed-off-by: Ozan Unsal --- doc/configuration.rst | 12 ++++++++++++ pungi/checks.py | 4 ++++ pungi/phases/buildinstall.py | 4 +++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/configuration.rst b/doc/configuration.rst index 3c9f66d1..4aad6dba 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -672,6 +672,11 @@ Options **buildinstall_allow_reuse** = False (*bool*) -- When set to ``True``, *Pungi* will try to reuse buildinstall results from old compose specified by ``--old-composes``. +**buildinstall_packages** + (list) – Additional packages to be installed in the runroot environment + where lorax will run to create installer. Format: ``[(variant_uid_regex, + {arch|*: [package_globs]})]``. + Example ------- @@ -706,6 +711,13 @@ Example }) ] + # Additional packages to be installed in the Koji runroot environment where + # lorax will run. + buildinstall_packages = [ + ('^Simple$', { + '*': ['dummy-package'], + }) + ] .. note:: diff --git a/pungi/checks.py b/pungi/checks.py index 329c94fc..30114110 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -785,6 +785,10 @@ def make_schema(): "buildinstall_kickstart": {"$ref": "#/definitions/str_or_scm_dict"}, "buildinstall_use_guestmount": {"type": "boolean", "default": True}, "buildinstall_skip": _variant_arch_mapping({"type": "boolean"}), + "buildinstall_packages": { + "$ref": "#/definitions/package_mapping", + "default": [], + }, "global_ksurl": {"type": "url"}, "global_version": {"type": "string"}, "global_target": {"type": "string"}, diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index 9f34423c..f175bec1 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -809,7 +809,9 @@ class BuildinstallThread(WorkerThread): chown_paths.append(_get_log_dir(compose, variant, arch)) elif buildinstall_method == "buildinstall": packages += ["anaconda"] - + packages += get_arch_variant_data( + compose.conf, "buildinstall_packages", arch, variant + ) if self._reuse_old_buildinstall_result( compose, arch, variant, cmd, pkgset_phase ):