From a49bf3d74e4fab6ac5f2fa28b3e63e9d6a534bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 27 Feb 2017 12:48:06 +0100 Subject: [PATCH] gather: Filter comps group on depsolving input of optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow up of 8bc65a8be5ac1f41eb1e32ab03814112e84a1970. When resolving packages that go into optional variant, we only want to skip filtering groups when working on a top-level variant. Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/sources/source_comps.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pungi/phases/gather/sources/source_comps.py b/pungi/phases/gather/sources/source_comps.py index 6722af22..b9992080 100644 --- a/pungi/phases/gather/sources/source_comps.py +++ b/pungi/phases/gather/sources/source_comps.py @@ -36,9 +36,13 @@ class GatherSourceComps(pungi.phases.gather.source.GatherSourceBase): groups = set() comps = CompsWrapper(self.compose.paths.work.comps(arch=arch)) - if variant is not None and variant.groups: - # Get packages for a particular variant. If the variant has no - # groups listed, all groups will be used. + if variant is not None and (variant.groups or variant.type != 'variant'): + # Get packages for a particular variant. We want to skip the + # filtering if the variant is top-level and has no groups (to use + # all of them). + # For optional we always want to filter (and parent groups will be + # added later), for addons and layered products it makes no sense + # for the groups to be empty in the first place. comps.filter_groups(variant.groups) for i in comps.get_comps_groups():