!38 Update libdnf to 0.69.0
From: @anonymous_z Reviewed-by: @t_feng Signed-off-by: @t_feng
This commit is contained in:
commit
348611710f
@ -1,35 +0,0 @@
|
||||
From a361dabddcc342ef3c0d4023f8500b16364889a3 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kolarik <jkolarik@redhat.com>
|
||||
Date: Wed, 10 Aug 2022 05:21:38 +0000
|
||||
Subject: [PATCH] Fix listing a repository without cpeid (RhBug:2066334)
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://github.com/rpm-software-management/libdnf/commit/a361dabddcc342ef3c0d4023f8500b16364889a3
|
||||
|
||||
= changelog =
|
||||
type: bugfix
|
||||
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2066334
|
||||
---
|
||||
libdnf/repo/Repo.cpp | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libdnf/repo/Repo.cpp b/libdnf/repo/Repo.cpp
|
||||
index e1d5529327..557f727fdf 100644
|
||||
--- a/libdnf/repo/Repo.cpp
|
||||
+++ b/libdnf/repo/Repo.cpp
|
||||
@@ -1031,8 +1031,13 @@ bool Repo::Impl::loadCache(bool throwExcept, bool ignoreMissing)
|
||||
for (auto elem = yum_repomd->distro_tags; elem; elem = g_slist_next(elem)) {
|
||||
if (elem->data) {
|
||||
auto distroTag = static_cast<LrYumDistroTag *>(elem->data);
|
||||
- if (distroTag->tag)
|
||||
- distro_tags.emplace_back(distroTag->cpeid, distroTag->tag);
|
||||
+ if (distroTag->tag) {
|
||||
+ std::string cpeid_str;
|
||||
+ if (distroTag->cpeid) {
|
||||
+ cpeid_str = distroTag->cpeid;
|
||||
+ }
|
||||
+ distro_tags.emplace_back(std::move(cpeid_str), distroTag->tag);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
From e250992c0be4b555c2dd6ef3ed89ab86892027ee Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
|
||||
Date: Tue, 26 Oct 2021 09:33:51 +0200
|
||||
Subject: [PATCH] Add unittest for setting up repo with empty keyfile
|
||||
(RhBug:1994614)
|
||||
|
||||
Reference:https://github.com/rpm-software-management/libdnf/commit/e250992c0be4b555c2dd6ef3ed89ab86892027ee
|
||||
Conflict:NA
|
||||
|
||||
The test ensures we don't crash when the keyfile is empty/not loaded.
|
||||
Test for: https://github.com/rpm-software-management/libdnf/commit/be66d0908d939ddaf3022c5489012bd1dbdb0075
|
||||
|
||||
RHEL bug:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1994614
|
||||
Fedora bug:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1946024
|
||||
---
|
||||
tests/libdnf/dnf-self-test.c | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/tests/libdnf/dnf-self-test.c b/tests/libdnf/dnf-self-test.c
|
||||
index 32a21e6628..5295837192 100644
|
||||
--- a/tests/libdnf/dnf-self-test.c
|
||||
+++ b/tests/libdnf/dnf-self-test.c
|
||||
@@ -199,6 +199,26 @@ ch_test_repo_func(void)
|
||||
g_object_unref(context);
|
||||
}
|
||||
|
||||
+static void
|
||||
+dnf_repo_setup_with_empty_keyfile(void)
|
||||
+{
|
||||
+ DnfContext *context = dnf_context_new();
|
||||
+ dnf_context_set_release_ver(context, "33");
|
||||
+ DnfRepo *repo = dnf_repo_new(context);
|
||||
+ GKeyFile *empty_key_file = g_key_file_new();
|
||||
+
|
||||
+ dnf_repo_set_keyfile(repo, empty_key_file);
|
||||
+
|
||||
+ GError *error = NULL;
|
||||
+ // Empty key file is not an errror, there is just no configuration to be loaded.
|
||||
+ g_assert(dnf_repo_setup(repo, &error));
|
||||
+ g_assert_no_error(error);
|
||||
+
|
||||
+ g_object_unref(repo);
|
||||
+ g_object_unref(context);
|
||||
+ g_key_file_free(empty_key_file);
|
||||
+}
|
||||
+
|
||||
static guint _allow_cancel_updates = 0;
|
||||
static guint _action_updates = 0;
|
||||
static guint _package_progress_updates = 0;
|
||||
@@ -1217,6 +1237,7 @@ main(int argc, char **argv)
|
||||
g_test_add_func("/libdnf/lock", dnf_lock_func);
|
||||
g_test_add_func("/libdnf/lock[threads]", dnf_lock_threads_func);
|
||||
g_test_add_func("/libdnf/repo", ch_test_repo_func);
|
||||
+ g_test_add_func("/libdnf/repo_empty_keyfile", dnf_repo_setup_with_empty_keyfile);
|
||||
g_test_add_func("/libdnf/state", dnf_state_func);
|
||||
g_test_add_func("/libdnf/state[child]", dnf_state_child_func);
|
||||
g_test_add_func("/libdnf/state[parent-1-step]", dnf_state_parent_one_step_proxy_func);
|
||||
@ -1,36 +0,0 @@
|
||||
From eff7e688e2f1ad5d10a5ed05948c08141083f316 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hr=C3=A1zk=C3=BD?= <lhrazky@redhat.com>
|
||||
Date: Mon, 20 Jun 2022 16:02:11 +0200
|
||||
Subject: [PATCH] Gracefully handle failure to open repo primary file
|
||||
|
||||
Reference:https://github.com/rpm-software-management/libdnf/commit/eff7e688e2f1ad5d10a5ed05948c08141083f316
|
||||
Conflict:NA
|
||||
|
||||
---
|
||||
libdnf/dnf-sack.cpp | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp
|
||||
index a88e8a1..a89fc15 100644
|
||||
--- a/libdnf/dnf-sack.cpp
|
||||
+++ b/libdnf/dnf-sack.cpp
|
||||
@@ -718,7 +718,15 @@ load_yum_repo(DnfSack *sack, HyRepo hrepo, GError **error)
|
||||
goto out;
|
||||
}
|
||||
fp_primary = solv_xfopen(primary.c_str(), "r");
|
||||
- assert(fp_primary);
|
||||
+ if (fp_primary == 0) {
|
||||
+ g_set_error(error,
|
||||
+ DNF_ERROR,
|
||||
+ DNF_ERROR_INTERNAL_ERROR,
|
||||
+ _("Opening repository primary data has failed: %s"),
|
||||
+ strerror(errno));
|
||||
+ retval = FALSE;
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
g_debug("fetching %s", name);
|
||||
if (repo_add_repomdxml(repo, fp_repomd, 0) || \
|
||||
--
|
||||
2.23.0
|
||||
|
||||
Binary file not shown.
BIN
libdnf-0.69.0.tar.gz
Normal file
BIN
libdnf-0.69.0.tar.gz
Normal file
Binary file not shown.
15
libdnf.spec
15
libdnf.spec
@ -1,4 +1,4 @@
|
||||
%global libsolv_version 0.7.20
|
||||
%global libsolv_version 0.7.21
|
||||
%global libmodulemd_version 2.13.0
|
||||
%global librepo_version 1.13.1
|
||||
%global dnf_conflict 4.2.23-6
|
||||
@ -17,21 +17,17 @@
|
||||
%{nil}
|
||||
|
||||
Name: libdnf
|
||||
Version: 0.65.0
|
||||
Release: 3
|
||||
Version: 0.69.0
|
||||
Release: 1
|
||||
Summary: Library providing simplified C and Python API to libsolv
|
||||
License: LGPLv2+
|
||||
URL: https://github.com/rpm-software-management/libdnf
|
||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch6000: add-unittest-for-setting-up-repo-with-empty-keyfile.patch
|
||||
Patch6001: gracefully-handle-failure-to-open-repo-primary-file.patch
|
||||
Patch6002: Fix-listing-a-repository-without-cpeid.patch
|
||||
|
||||
BuildRequires: cmake gcc gcc-c++ libsolv-devel >= %{libsolv_version} gettext
|
||||
BuildRequires: pkgconfig(librepo) >= %{librepo_version} pkgconfig(check)
|
||||
BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0 pkgconfig(gtk-doc) gpgme-devel
|
||||
BuildRequires: rpm-devel >= 4.11.0 pkgconfig(sqlite3) pkgconfig(smartcols)
|
||||
BuildRequires: rpm-devel >= 4.15.0 pkgconfig(sqlite3) pkgconfig(smartcols)
|
||||
BuildRequires: pkgconfig(json-c) pkgconfig(cppunit) pkgconfig(libcrypto)
|
||||
BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version}
|
||||
|
||||
@ -122,6 +118,9 @@ popd
|
||||
%{python3_sitearch}/hawkey/
|
||||
|
||||
%changelog
|
||||
* Sat Nov 5 2022 zhangrui <zhangrui182@huawei.com> - 0.69.0-1
|
||||
- DES:Update libdnf to 0.69.0
|
||||
|
||||
* Tue Sep 20 2022 zhangrui <zhangrui182@huawei.com> - 0.65.0-3
|
||||
- DESC:backport patches fix listing a repository without cpeid
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user