From 0525768519a2e1a015cfec3ddbe86e47a1ddd5c1 Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Tue, 28 Apr 2020 09:50:01 +0800 Subject: [PATCH] Add pkgset_allow_reuse option JIRA: RHELCMP-492 Signed-off-by: Haibo Lin --- doc/configuration.rst | 4 ++++ pungi/checks.py | 1 + pungi/phases/pkgset/pkgsets.py | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/doc/configuration.rst b/doc/configuration.rst index 8a1769d2..f56ab4cc 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -505,6 +505,10 @@ Options with everything. Set this option to ``False`` to ignore ``noarch`` in ``ExclusiveArch`` and always consider only binary architectures. +**pkgset_allow_reuse** = True + (*bool*) -- When set to ``True``, *Pungi* will try to reuse pkgset data + from old compose specified by ``--old-composes``. + Example ------- diff --git a/pungi/checks.py b/pungi/checks.py index a796d51b..a77bfdd6 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -642,6 +642,7 @@ def make_schema(): }, "gather_profiler": {"type": "boolean", "default": False}, "gather_allow_reuse": {"type": "boolean", "default": False}, + "pkgset_allow_reuse": {"type": "boolean", "default": True}, "pkgset_source": {"type": "string", "enum": ["koji", "repos"]}, "createrepo_c": {"type": "boolean", "default": True}, "createrepo_checksum": { diff --git a/pungi/phases/pkgset/pkgsets.py b/pungi/phases/pkgset/pkgsets.py index 674d828a..8a1ec1e1 100644 --- a/pungi/phases/pkgset/pkgsets.py +++ b/pungi/phases/pkgset/pkgsets.py @@ -627,6 +627,10 @@ class KojiPackageSet(PackageSetBase): :param include_packages: an iterable of tuples (package name, arch) that should be included. """ + if not compose.conf["pkgset_allow_reuse"]: + self.log_info("Reusing pkgset data from old compose is disabled.") + return False + self.log_info("Trying to reuse pkgset data of old compose") if not compose.paths.get_old_compose_topdir(): self.log_debug("No old compose found. Nothing to reuse.")