From e419100d5f203828048428a4e403a4a5f8f1686c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 25 Apr 2018 15:12:38 +0200 Subject: [PATCH] pkgset: Allow different inheritance for modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With one compose combining traditional and modular content there might be different requirements for tag inheritance. This patch adds a new option that controls whether builds in modular tags should be inherited. It defaults to False, which is the right option for current MBS behavior. JIRA: COMPOSE-2148 Signed-off-by: Lubomír Sedlář --- doc/configuration.rst | 3 +++ pungi/checks.py | 4 ++++ pungi/phases/pkgset/sources/source_koji.py | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/configuration.rst b/doc/configuration.rst index 47eca587..88ccab21 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -458,6 +458,9 @@ Options (*bool*) -- inherit builds from parent tags; we can turn it off only if we have all builds tagged in a single tag +**pkgset_koji_inherit_modules** = False + (*bool*) -- the same as above, but this only applies to modular tags + **pkgset_repos** (*dict*) -- A mapping of architectures to repositories with RPMs: ``{arch: [repo]}``. Only use when ``pkgset_source = "repos"``. diff --git a/pungi/checks.py b/pungi/checks.py index f85efe9f..d84f24ad 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -748,6 +748,10 @@ def make_schema(): "type": "boolean", "default": True }, + "pkgset_koji_inherit_modules": { + "type": "boolean", + "default": False + }, "disc_types": { "type": "object", diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index ec93ec3a..a79afedc 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -484,6 +484,7 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event_id): compose_tags.extend(force_list(compose.conf["pkgset_koji_tag"])) inherit = compose.conf["pkgset_koji_inherit"] + inherit_modules = compose.conf["pkgset_koji_inherit_modules"] global_pkgset_path = os.path.join( compose.paths.work.topdir(arch="global"), "pkgset_global.pickle") if compose.DEBUG and os.path.isfile(global_pkgset_path): @@ -517,7 +518,9 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event_id): # with underscores just to be safe. logfile = compose.paths.log.log_file( None, 'packages_from_%s' % compose_tag.replace('/', '_')) - pkgset.populate(compose_tag, event_id, inherit=inherit, logfile=logfile) + is_traditional = compose_tag in compose.conf.get('pkgset_koji_tag', []) + should_inherit = inherit if is_traditional else inherit_modules + pkgset.populate(compose_tag, event_id, inherit=should_inherit, logfile=logfile) for variant in compose.all_variants.values(): if compose_tag in variant_tags[variant]: # Optimization for case where we have just single compose