From aab3b04b08ae8082de1fb080a4db0cb359c66396 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Apr 10 2018 06:21:56 +0000 Subject: gather: Use comps for given variant The file for variant is filtered to only contain relevant parts. Signed-off-by: Lubomír Sedlář --- diff --git a/pungi/phases/gather/methods/method_nodeps.py b/pungi/phases/gather/methods/method_nodeps.py index ffc8e46..d1aa21e 100644 --- a/pungi/phases/gather/methods/method_nodeps.py +++ b/pungi/phases/gather/methods/method_nodeps.py @@ -45,7 +45,7 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase): "debuginfo": [], } - group_packages = expand_groups(self.compose, arch, groups) + group_packages = expand_groups(self.compose, arch, variant, groups) packages = pkgs | group_packages log.write('Requested packages:\n%s\n' % pformat(packages)) @@ -117,9 +117,9 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase): return result -def expand_groups(compose, arch, groups): - """Read comps file filtered for given architecture and return all packages - in given groups. +def expand_groups(compose, arch, variant, groups): + """Read comps file filtered for given architecture and variant and return + all packages in given groups. :returns: A set of tuples (pkg_name, arch) """ @@ -127,7 +127,7 @@ def expand_groups(compose, arch, groups): # No groups, nothing to do (this also covers case when there is no # comps file. return set() - comps_file = compose.paths.work.comps(arch, create_dir=False) + comps_file = compose.paths.work.comps(arch, variant, create_dir=False) comps = CompsWrapper(comps_file) packages = set() diff --git a/tests/test_gather_method_nodeps.py b/tests/test_gather_method_nodeps.py index cf22476..4b9d5f0 100644 --- a/tests/test_gather_method_nodeps.py +++ b/tests/test_gather_method_nodeps.py @@ -20,7 +20,7 @@ class TestWritePungiConfig(helpers.PungiTestCase): self.compose.paths.work.comps = mock.Mock(return_value=COMPS_FILE) def test_expand_group(self): - packages = nodeps.expand_groups(self.compose, 'x86_64', ['core', 'text-internet']) + packages = nodeps.expand_groups(self.compose, 'x86_64', None, ['core', 'text-internet']) self.assertItemsEqual(packages, [('dummy-bash', 'x86_64'), ('dummy-elinks', 'x86_64'), ('dummy-tftp', 'x86_64')])