From ca1a21b923c316c0b28875a9b653af8b2b33d52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Thu, 19 Sep 2024 17:16:15 +0200 Subject: [PATCH] Fix dependencies and test for DNF4 based osbuild-depsolve-dnf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For the DNF4 version, we actually use 'dnf' package and not 'libdnf'. Fix the SPEC file dependencies and also the check in unit test. Signed-off-by: Tomáš Hozza --- osbuild.spec | 4 ++-- tools/test/test_depsolve.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osbuild.spec b/osbuild.spec index 880afe32..87bd4d59 100644 --- a/osbuild.spec +++ b/osbuild.spec @@ -137,11 +137,11 @@ manifests and osbuild. Summary: Dependency solving support for DNF Requires: %{name} = %{version}-%{release} -# Fedora 41 and later use libdnf5, RHEL and Fedora < 41 use libdnf +# Fedora 41 and later use libdnf5, RHEL and Fedora < 41 use dnf %if 0%{?fedora} >= 41 Requires: python3-libdnf5 >= 5.2.1 %else -Requires: python3-libdnf +Requires: python3-dnf %endif # osbuild 125 added a new "solver" field and osbuild-composer only diff --git a/tools/test/test_depsolve.py b/tools/test/test_depsolve.py index 13ffad38..94ef0161 100644 --- a/tools/test/test_depsolve.py +++ b/tools/test/test_depsolve.py @@ -35,8 +35,8 @@ def assert_dnf5(): def assert_dnf(): - if sp.run(["/usr/bin/python3", "-c", "import libdnf"], check=False).returncode != 0: - raise RuntimeError("Cannot import libdnf") + if sp.run(["/usr/bin/python3", "-c", "import dnf"], check=False).returncode != 0: + raise RuntimeError("Cannot import dnf") def depsolve(transactions, repos, root_dir, cache_dir, dnf_config, opt_metadata, with_sbom=False) -> Tuple[dict, int]: