diff --git a/pungi/phases/gather/methods/method_hybrid.py b/pungi/phases/gather/methods/method_hybrid.py index 0dcde6f6..d996236c 100644 --- a/pungi/phases/gather/methods/method_hybrid.py +++ b/pungi/phases/gather/methods/method_hybrid.py @@ -162,6 +162,7 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase): multilib_whitelist=[], multilib_blacklist=[], filter_packages=[], + prepopulate=[], **kwargs ): self.arch = arch @@ -186,6 +187,8 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase): expand_groups(self.compose, arch, variant, groups, set_pkg_arch=False) ) + packages.update(tuple(pkg.rsplit(".", 1)) for pkg in prepopulate) + # Filters are received as tuples (name, arch), we should convert it to # strings. filter_packages = [_fmt_pkg(*p) for p in filter_packages] diff --git a/tests/test_gather_method_hybrid.py b/tests/test_gather_method_hybrid.py index 2e355e30..1abb5aed 100644 --- a/tests/test_gather_method_hybrid.py +++ b/tests/test_gather_method_hybrid.py @@ -48,13 +48,28 @@ class TestMethodHybrid(helpers.PungiTestCase): arch = "x86_64" variant = compose.variants["Server"] - res = m(arch, variant, package_sets, set(["pkg"]), ["standard"]) + res = m( + arch, + variant, + package_sets, + set(["pkg"]), + ["standard"], + prepopulate=["prep.noarch"], + ) self.assertEqual(res, ep.return_value) self.assertEqual(cmr.call_args_list, [mock.call(compose, variant, arch)]) self.assertEqual( m.run_solver.call_args_list, - [mock.call(variant, arch, set(["pkg", "foo", "bar"]), cmr.return_value, [])], + [ + mock.call( + variant, + arch, + set(["pkg", "foo", "bar", ("prep", "noarch")]), + cmr.return_value, + [], + ) + ], ) self.assertEqual( ep.call_args_list,