diff --git a/pungi/phases/pkgset/pkgsets.py b/pungi/phases/pkgset/pkgsets.py index 293bd5b0..14cad381 100644 --- a/pungi/phases/pkgset/pkgsets.py +++ b/pungi/phases/pkgset/pkgsets.py @@ -739,6 +739,12 @@ class KojiPackageSet(PackageSetBase): "srpms_by_name": self.srpms_by_name, "extra_builds": self.extra_builds, "include_packages": include_packages, + "inherit_to_noarch": compose.conf[ + "pkgset_inherit_exclusive_arch_to_noarch" + ], + "exclusive_noarch": compose.conf[ + "pkgset_exclusive_arch_considers_noarch" + ], }, f, protocol=pickle.HIGHEST_PROTOCOL, @@ -833,6 +839,8 @@ class KojiPackageSet(PackageSetBase): self.log_debug("Failed to load reuse file: %s" % str(e)) return False + inherit_to_noarch = compose.conf["pkgset_inherit_exclusive_arch_to_noarch"] + exclusive_noarch = compose.conf["pkgset_exclusive_arch_considers_noarch"] if ( reuse_data["allow_invalid_sigkeys"] == self._allow_invalid_sigkeys and reuse_data["packages"] == self.packages @@ -840,6 +848,10 @@ class KojiPackageSet(PackageSetBase): and reuse_data["extra_builds"] == self.extra_builds and reuse_data["sigkeys"] == self.sigkey_ordering and reuse_data["include_packages"] == include_packages + # If the value is not present in reuse data, the compose was + # generated with older version of Pungi. Best to not reuse. + and reuse_data.get("inherit_to_noarch") == inherit_to_noarch + and reuse_data.get("exclusive_noarch") == exclusive_noarch ): self.log_info("Copying repo data for reuse: %s" % old_repo_dir) copy_all(old_repo_dir, repo_dir) diff --git a/tests/test_pkgset_pkgsets.py b/tests/test_pkgset_pkgsets.py index 55295167..abc57c77 100644 --- a/tests/test_pkgset_pkgsets.py +++ b/tests/test_pkgset_pkgsets.py @@ -1100,6 +1100,8 @@ class TestReuseKojiMockPkgset(helpers.PungiTestCase): "include_packages": None, "rpms_by_arch": mock.Mock(), "srpms_by_name": mock.Mock(), + "exclusive_noarch": True, + "inherit_to_noarch": True, } ) self.pkgset.old_file_cache = mock.Mock()