From 5dd2b3947d17e9a5d6cf16837a996c41297b7d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 6 Mar 2017 15:25:55 +0100 Subject: [PATCH] Rename option to switch gather backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling it gather_backend is similar to repoclosure_backend we already have. It's also more obvious what it does. Signed-off-by: Lubomír Sedlář --- doc/configuration.rst | 8 ++++---- pungi/checks.py | 6 +++++- pungi/phases/gather/methods/method_deps.py | 9 +++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/configuration.rst b/doc/configuration.rst index ad583f76..d4df326b 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -531,10 +531,10 @@ Options * With ``greedy_method = "build" ``pkg-b-provider-1`` and ``pkg-b-provider-2`` will be pulled in. -**dnf_gather** = False - (*bool*) -- When set to ``True``, DNF backend is used instead of YUM. This - changes the entire codebase doing dependency solving, so it can change the - result in unpredictable ways. +**gather_backend** = ``yum`` + (*str*) -- Either ``yum`` or ``dnf``. This changes the entire codebase + doing dependency solving, so it can change the result in unpredictable + ways. Particularly the multilib work is performed differently by using ``python-multilib`` library. Please refer to ``multilib`` option to see the diff --git a/pungi/checks.py b/pungi/checks.py index eae39962..8ff6b2d8 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -505,7 +505,11 @@ def _make_schema(): }, "gather_prepopulate": {"$ref": "#/definitions/str_or_scm_dict"}, "gather_source_mapping": {"type": "string"}, - "dnf_gather": {"type": "boolean", "default": False}, + "gather_backend": { + "type": "string", + "enum": ["yum", "dnf"], + "default": "yum", + }, "pkgset_source": { "type": "string", diff --git a/pungi/phases/gather/methods/method_deps.py b/pungi/phases/gather/methods/method_deps.py index 50f82357..6d1f8627 100644 --- a/pungi/phases/gather/methods/method_deps.py +++ b/pungi/phases/gather/methods/method_deps.py @@ -119,10 +119,11 @@ def resolve_deps(compose, arch, variant): tmp_dir = compose.paths.work.tmp_dir(arch, variant) cache_dir = compose.paths.work.pungi_cache_dir(arch, variant) # TODO: remove YUM code, fully migrate to DNF - if compose.conf.get("dnf_gather", False): - get_cmd = pungi_wrapper.get_pungi_cmd_dnf - else: - get_cmd = pungi_wrapper.get_pungi_cmd + backends = { + 'yum': pungi_wrapper.get_pungi_cmd, + 'dnf': pungi_wrapper.get_pungi_cmd_dnf, + } + get_cmd = backends[compose.conf['gather_backend']] cmd = get_cmd(pungi_conf, destdir=tmp_dir, name=variant.uid, selfhosting=selfhosting, fulltree=fulltree, arch=yum_arch, full_archlist=True, greedy=greedy_method, cache_dir=cache_dir,