diff --git a/module_build_service/builder/KojiContentGenerator.py b/module_build_service/builder/KojiContentGenerator.py index b633b04d..5da00039 100644 --- a/module_build_service/builder/KojiContentGenerator.py +++ b/module_build_service/builder/KojiContentGenerator.py @@ -465,6 +465,13 @@ class KojiContentGenerator(object): # Check each RPM in `self.rpms_dict` to find out if it can be included in mmd # for this architecture. for nevra, rpm in self.rpms_dict.items(): + # Filter out RPMs which will never end up in final modulemd: + # - the architecture of an RPM is not multilib architecture for `arch`. + # - the architecture of an RPM is not the final mmd architecture. + # - the architecture of an RPM is not "noarch". + if rpm["arch"] not in multilib_arches and rpm["arch"] not in [arch, "noarch"]: + continue + srpm = rpm["srpm_name"] # Skip the RPM if it is excluded on this arch or exclusive diff --git a/tests/test_content_generator.py b/tests/test_content_generator.py index b272f680..1595eb07 100644 --- a/tests/test_content_generator.py +++ b/tests/test_content_generator.py @@ -432,8 +432,10 @@ class TestBuild: def test_fill_in_rpms_list(self): self._add_test_rpm("dhcp-libs-12:4.3.5-5.module_2118aef6.x86_64", "dhcp") self._add_test_rpm("dhcp-libs-12:4.3.5-5.module_2118aef6.i686", "dhcp") + self._add_test_rpm("dhcp-libs-12:4.3.5-5.module_2118aef6.s390x", "dhcp") self._add_test_rpm("perl-Tangerine-12:4.3.5-5.module_2118aef6.x86_64", "perl-Tangerine") self._add_test_rpm("perl-Tangerine-12:4.3.5-5.module_2118aef6.i686", "perl-Tangerine") + self._add_test_rpm("perl-Tangerine-12:4.3.5-5.module_2118aef6.s390x", "perl-Tangerine") mmd = self.cg.module.mmd() mmd = self.cg._fill_in_rpms_list(mmd, "x86_64")