#1040 Fix wrong inclusion of non-multilib packages in final MMD.
Merged 2 years ago by jkaluza. Opened 2 years ago by jkaluza.
jkaluza/fm-orchestrator cg-fix  into  master

@@ -465,6 +465,13 @@ 

          # 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

@@ -432,8 +432,10 @@ 

      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")

The original Pungi code, on which MBS code is based on, always passed only RPMs
with valid architectures to further decide if their subset should end up in a
final modulemd file.

In MBS, we pass RPMs with all architectures and there was no code to actually filter
out the RPMs which are from architectures which should never end up in a final MMD.

By an lucky accident, the current code was able to filter out multilib architectures, so
for example "i686" did not appear in "x86_64" final MMD. But for example "s390x" RPMs
appeared in the x86_64 final MMD and we had no tests for this scenario...

This commit checks that RPMs for completely different architectures will never
be considered to be included in a final MMD.

Some typos in the comment, but otherwise :thumbsup:

rebased onto bcb104a

2 years ago

Commit 2c29d90 fixes this pull-request

Pull-Request has been merged by jkaluza

2 years ago

Pull-Request has been merged by jkaluza

2 years ago