From 9ca454007a3ec4d1d2103dd4117f5c3e277fef0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 17 Jul 2018 14:40:07 +0200 Subject: [PATCH] gather: Early exit for non-comps sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When getting list of initial packages, only run the source and do nothing else. Additional package, system-release etc. will be added only to comps. Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/__init__.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index f845e286..a243cd03 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -610,27 +610,23 @@ def get_variant_packages(compose, arch, variant, source_name, package_sets=None) When system-release packages should be filtered, the ``package_sets`` argument is required. """ - packages, groups, filter_packages = set(), set(), set() + filter_packages = set() GatherSource = get_gather_source(source_name) source = GatherSource(compose) - p, g = source(arch, variant) + packages, groups = source(arch, variant) - if source_name != "comps" and not p and not g: - # For modules and json source, if the source did not return anything, - # we should skip all further work. Additional packages and possibly - # system-release will be added to comps source. + if source_name != "comps": + # For modules and json source we want just the explicit packages. + # Additional packages and possibly system-release will be added to + # comps source. return packages, groups, filter_packages - packages |= p - groups |= g - if variant is None: # no variant -> no parent -> we have everything we need # doesn't make sense to do any package filtering return packages, groups, filter_packages - if source_name == 'comps': - packages |= get_additional_packages(compose, arch, variant) + packages |= get_additional_packages(compose, arch, variant) filter_packages |= get_filter_packages(compose, arch, variant) if compose.conf['filter_system_release_packages']: