pkgset: Allow different inheritance for modules

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-04-25 15:12:38 +02:00
parent d3938d7c04
commit e419100d5f
3 changed files with 11 additions and 1 deletions

View File

@ -458,6 +458,9 @@ Options
(*bool*) -- inherit builds from parent tags; we can turn it off only if we (*bool*) -- inherit builds from parent tags; we can turn it off only if we
have all builds tagged in a single tag 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** **pkgset_repos**
(*dict*) -- A mapping of architectures to repositories with RPMs: ``{arch: (*dict*) -- A mapping of architectures to repositories with RPMs: ``{arch:
[repo]}``. Only use when ``pkgset_source = "repos"``. [repo]}``. Only use when ``pkgset_source = "repos"``.

View File

@ -748,6 +748,10 @@ def make_schema():
"type": "boolean", "type": "boolean",
"default": True "default": True
}, },
"pkgset_koji_inherit_modules": {
"type": "boolean",
"default": False
},
"disc_types": { "disc_types": {
"type": "object", "type": "object",

View File

@ -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"])) compose_tags.extend(force_list(compose.conf["pkgset_koji_tag"]))
inherit = compose.conf["pkgset_koji_inherit"] inherit = compose.conf["pkgset_koji_inherit"]
inherit_modules = compose.conf["pkgset_koji_inherit_modules"]
global_pkgset_path = os.path.join( global_pkgset_path = os.path.join(
compose.paths.work.topdir(arch="global"), "pkgset_global.pickle") compose.paths.work.topdir(arch="global"), "pkgset_global.pickle")
if compose.DEBUG and os.path.isfile(global_pkgset_path): 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. # with underscores just to be safe.
logfile = compose.paths.log.log_file( logfile = compose.paths.log.log_file(
None, 'packages_from_%s' % compose_tag.replace('/', '_')) 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(): for variant in compose.all_variants.values():
if compose_tag in variant_tags[variant]: if compose_tag in variant_tags[variant]:
# Optimization for case where we have just single compose # Optimization for case where we have just single compose