From e573246a2ac08463529db26b1889bf0acc49ef00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 8 Feb 2019 14:11:58 +0100 Subject: [PATCH] hybrid: Get platform from lookaside repos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the hybrid solver is used in a situation where there are modules in lookaside repo, but not in the compose itself, it will fail to detect any platform. Since we are already opening the module repodata, we can retrieve platforms from all modules in there as well. If there are conflicts (e.g. multiple modules depending on different platforms), an error will be reported. JIRA: COMPOSE-3277 Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/methods/method_hybrid.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pungi/phases/gather/methods/method_hybrid.py b/pungi/phases/gather/methods/method_hybrid.py index d996236c..830f7cd9 100644 --- a/pungi/phases/gather/methods/method_hybrid.py +++ b/pungi/phases/gather/methods/method_hybrid.py @@ -344,6 +344,7 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase): def get_lookaside_modules(lookasides): """Get list of NSVC of all modules in all lookaside repos.""" modules = set() + platforms = set() for repo in lookasides: repo = fus._prep_path(repo) repomd = cr.Repomd(os.path.join(repo, "repodata/repomd.xml")) @@ -365,7 +366,11 @@ def get_lookaside_modules(lookasides): mmd.peek_context(), ) ) - return modules + for dep in mmd.peek_dependencies(): + streams = dep.peek_requires().get("platform") + if streams: + platforms.update(streams.dup()) + return modules, platforms def create_module_repo(compose, variant, arch): @@ -378,9 +383,7 @@ def create_module_repo(compose, variant, arch): compose.log_debug("[BEGIN] %s" % msg) - platforms = set() - - lookaside_modules = get_lookaside_modules( + lookaside_modules, platforms = get_lookaside_modules( pungi.phases.gather.get_lookaside_repos(compose, arch, variant) )