diff --git a/pungi/phases/gather/sources/source_comps.py b/pungi/phases/gather/sources/source_comps.py
index 0e3d5cc2..02ae8554 100644
--- a/pungi/phases/gather/sources/source_comps.py
+++ b/pungi/phases/gather/sources/source_comps.py
@@ -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():
diff --git a/tests/data/dummy-variants.xml b/tests/data/dummy-variants.xml
index e43446fc..ad485647 100644
--- a/tests/data/dummy-variants.xml
+++ b/tests/data/dummy-variants.xml
@@ -27,6 +27,13 @@
+
+
+ i386
+ x86_64
+
+
+
i386