diff --git a/pungi/phases/gather/sources/source_comps.py b/pungi/phases/gather/sources/source_comps.py index 655c7673..447e0a47 100644 --- a/pungi/phases/gather/sources/source_comps.py +++ b/pungi/phases/gather/sources/source_comps.py @@ -39,7 +39,8 @@ class GatherSourceComps(pungi.phases.gather.source.GatherSourceBase): comps = CompsWrapper(self.compose.paths.work.comps(arch=arch)) - if variant is not None and (variant.groups or variant.type != 'variant'): + is_modular = variant and not variant.groups and variant.modules + if variant is not None and (variant.groups or variant.type != 'variant' or is_modular): # 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). diff --git a/pungi/phases/init.py b/pungi/phases/init.py index cbda4949..a01168a9 100644 --- a/pungi/phases/init.py +++ b/pungi/phases/init.py @@ -45,12 +45,16 @@ class InitPhase(PhaseBase): # write variant comps for variant in self.compose.get_variants(): + is_modular = not variant.groups and variant.modules for arch in variant.arches: - if variant.groups or variant.type == 'optional': + if variant.groups or variant.type == 'optional' or is_modular: # The variant lists only some groups, run filter. Other # option is that it's optional variant, in which case # we want to filter everything (unless there was # explicit list in which case it will be used). + # For fully modular variant (one without groups but + # with modules) we also want to filter (effectively + # producing empty comps). write_variant_comps(self.compose, arch, variant) else: # The variant does not mention any groups, copy diff --git a/tests/test_initphase.py b/tests/test_initphase.py index 7d8b639a..ae6c4e52 100644 --- a/tests/test_initphase.py +++ b/tests/test_initphase.py @@ -53,6 +53,7 @@ class TestInitPhase(PungiTestCase): compose = DummyCompose(self.topdir, {}) compose.has_comps = True compose.variants['Everything'].groups = [] + compose.variants['Everything'].modules = [] phase = init.InitPhase(compose) phase.run()