Treat variants without comps groups as having all of them

If the `<groups></groups>` section is not specified in the variants XML
file, all groups will be used in this variant. The section must be
omitted completely, not just empty. This is (and was) correct according
to the DTD, it just lead to crash before.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-06-28 08:48:15 +02:00
parent 8323a735e7
commit 11bbbae2ed
2 changed files with 10 additions and 2 deletions

View File

@ -48,8 +48,9 @@ class GatherSourceComps(pungi.phases.gather.source.GatherSourceBase):
groups = set()
comps = CompsWrapper(self.compose.paths.work.comps(arch=arch))
if variant is not None:
# get packages for a particular variant
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.
comps.filter_groups(variant.groups)
for i in comps.get_comps_groups():

View File

@ -27,6 +27,13 @@
</groups>
</variant>
<variant id="Everything" name="Everything" type="variant">
<arches>
<arch>i386</arch>
<arch>x86_64</arch>
</arches>
</variant>
<variant id="Client" name="Client" type="variant" has_optional="true">
<arches>
<arch>i386</arch>