diff --git a/887.patch b/887.patch new file mode 100644 index 0000000..aae50e2 --- /dev/null +++ b/887.patch @@ -0,0 +1,59 @@ +From f18d11984a91e85369218b2c2361425c04671997 Mon Sep 17 00:00:00 2001 +From: Jaroslav Rohel +Date: Wed, 29 Jan 2020 08:58:17 +0100 +Subject: [PATCH] [context] Create new repo instead of reusing old one + +Function dnf_repo_check_internal() was reusing a libdnf::Repo objects. +They were detached from libsolv repository and reseted for new usage. + +New libdnf::Repo class instantions are created now. The old remain +connected with libsolv repository. +It can solve some PackageKit problems. +eg. https://bugzilla.redhat.com/show_bug.cgi?id=1795004 +--- + libdnf/dnf-repo.cpp | 29 +++++++---------------------- + 1 file changed, 7 insertions(+), 22 deletions(-) + +diff --git a/libdnf/dnf-repo.cpp b/libdnf/dnf-repo.cpp +index 45f6d0145..4c56fe3a5 100644 +--- a/libdnf/dnf-repo.cpp ++++ b/libdnf/dnf-repo.cpp +@@ -1470,31 +1470,16 @@ dnf_repo_check_internal(DnfRepo *repo, + } + } + +- /* init */ +- repoImpl->detachLibsolvRepo(); +- repoImpl->needs_internalizing = false; +- repoImpl->state_main = _HY_NEW; +- repoImpl->state_filelists = _HY_NEW; +- repoImpl->state_presto = _HY_NEW; +- repoImpl->state_updateinfo = _HY_NEW; +- repoImpl->state_other = _HY_NEW; +- repoImpl->filenames_repodata = 0; +- repoImpl->presto_repodata = 0; +- repoImpl->updateinfo_repodata = 0; +- repoImpl->other_repodata = 0; +- repoImpl->load_flags = 0; +- /* the following three elements are needed for repo rewriting */ +- repoImpl->main_nsolvables = 0; +- repoImpl->main_nrepodata = 0; +- repoImpl->main_end = 0; +- priv->repo->setUseIncludes(false); +- +- repoImpl->repomdFn = yum_repo->repomd; +- repoImpl->metadataPaths.clear(); ++ /* init newRepo */ ++ auto newRepo = hy_repo_create(priv->repo->getId().c_str()); ++ hy_repo_free(priv->repo); ++ priv->repo = newRepo; ++ auto newRepoImpl = libdnf::repoGetImpl(newRepo); ++ newRepoImpl->repomdFn = yum_repo->repomd; + for (auto *elem = yum_repo->paths; elem; elem = g_slist_next(elem)) { + if (elem->data) { + auto yumrepopath = static_cast(elem->data); +- repoImpl->metadataPaths[yumrepopath->type] = yumrepopath->path; ++ newRepoImpl->metadataPaths[yumrepopath->type] = yumrepopath->path; + } + } + /* ensure we reset the values from the keyfile */ diff --git a/libdnf.spec b/libdnf.spec index 9f89295..7be0fcc 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -52,11 +52,15 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 2%{?dist} +Release: 3%{?dist} 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 +# https://github.com/rpm-software-management/libdnf/pull/887 +# Fixes a crash sometimes encountered in Cockpit: +# https://bugzilla.redhat.com/show_bug.cgi?id=1795004 +Patch0: 887.patch BuildRequires: cmake BuildRequires: gcc @@ -293,6 +297,9 @@ popd %endif %changelog +* Tue Feb 04 2020 Adam Williamson - 0.43.1-3 +- [context] Create new repo instead of reusing old one (RhBug:1795004) + * Wed Jan 29 2020 Fedora Release Engineering - 0.43.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild