diff --git a/pungi/phases/gather/sources/source_module.py b/pungi/phases/gather/sources/source_module.py index 782eb8db..38710916 100644 --- a/pungi/phases/gather/sources/source_module.py +++ b/pungi/phases/gather/sources/source_module.py @@ -142,6 +142,7 @@ class GatherSourceModule(pungi.phases.gather.source.GatherSourceBase): ) added_rpms.setdefault(nsvc_devel, []) added_rpms[nsvc_devel].append(str(rpm_obj.nevra)) + packages.add((rpm_obj, None)) log.write("Adding %s to %s module\n" % (rpm_obj, nsvc_devel)) # GatherSource returns all the packages in variant and does not diff --git a/tests/test_gather_source_module.py b/tests/test_gather_source_module.py index fdfff51f..1d260979 100644 --- a/tests/test_gather_source_module.py +++ b/tests/test_gather_source_module.py @@ -80,3 +80,25 @@ class TestGatherSourceModule(helpers.PungiTestCase): variant = self.compose.variants["Server"] arch_mmd = variant.arch_mmds["x86_64"]["testmodule:master:1:2017"] self.assertEqual(len(arch_mmd.get_rpm_artifacts().get()), 0) + + def test_gather_filtered_module_include_devel_modules(self): + self.compose.conf['include_devel_modules'] = { + "Server": ["testmodule-devel:master"]} + + filter_set = Modulemd.SimpleSet() + filter_set.add("pkg") + self.mmd.set_rpm_filter(filter_set) + + source = GatherSourceModule(self.compose) + packages, groups = source("x86_64", self.compose.variants["Server"]) + + # Two packages, because -devel for x86_64 includes both x86_64 + # and i686. + self.assertEqual(len(packages), 2) + self.assertEqual(len(groups), 0) + + variant = self.compose.variants["Server"] + arch_mmd = variant.arch_mmds["x86_64"]["testmodule:master:1:2017"] + self.assertEqual(len(arch_mmd.get_rpm_artifacts().get()), 0) + arch_mmd = variant.arch_mmds["x86_64"]["testmodule-devel:master:1:2017"] + self.assertEqual(len(arch_mmd.get_rpm_artifacts().get()), 2)