Backport 2 patches

This commit is contained in:
Jaroslav Mracek 2018-10-17 14:02:36 +02:00
parent 12ef9ea97e
commit b473d937cf
3 changed files with 72 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 83a0b5f289fd9461b68b1afab525c0f4ca6015b1 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Mon, 15 Oct 2018 21:27:15 +0200
Subject: [PATCH] Modify solver_describe_decision to report cleaned (RhBug:1486749)
---
libdnf/goal/Goal.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libdnf/goal/Goal.cpp b/libdnf/goal/Goal.cpp
index 50fef5c..7d17a49 100644
--- a/libdnf/goal/Goal.cpp
+++ b/libdnf/goal/Goal.cpp
@@ -647,7 +647,8 @@ Goal::getReason(DnfPackage *pkg)
if (!pImpl->solv)
return HY_REASON_USER;
Id info;
- int reason = solver_describe_decision(pImpl->solv, dnf_package_get_id(pkg), &info);
+ const Id pkgID = dnf_package_get_id(pkg);
+ int reason = solver_describe_decision(pImpl->solv, pkgID, &info);
if ((reason == SOLVER_REASON_UNIT_RULE ||
reason == SOLVER_REASON_RESOLVE_JOB) &&
@@ -658,6 +659,13 @@ Goal::getReason(DnfPackage *pkg)
return HY_REASON_CLEAN;
if (reason == SOLVER_REASON_WEAKDEP)
return HY_REASON_WEAKDEP;
+ IdQueue cleanDepsQueue;
+ solver_get_cleandeps(pImpl->solv, cleanDepsQueue.getQueue());
+ for (int i = 0; i < cleanDepsQueue.size(); ++i) {
+ if (cleanDepsQueue[i] == pkgID) {
+ return HY_REASON_CLEAN;
+ }
+ }
return HY_REASON_DEP;
}
--
libgit2 0.26.6

View File

@ -0,0 +1,25 @@
From cc7776ba7e33770ad5744a67d32b03aaece992f8 Mon Sep 17 00:00:00 2001
From: Daniel Mach <dmach@redhat.com>
Date: Wed, 17 Oct 2018 12:12:18 +0200
Subject: [PATCH] [history] Fix crash in TransactionItem::addReplacedBy().
---
libdnf/transaction/TransactionItem.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdnf/transaction/TransactionItem.hpp b/libdnf/transaction/TransactionItem.hpp
index dc4e2c8..72684f7 100644
--- a/libdnf/transaction/TransactionItem.hpp
+++ b/libdnf/transaction/TransactionItem.hpp
@@ -110,7 +110,7 @@ public:
// int64_t getTransactionId() const noexcept { return trans.getId(); }
const std::vector< TransactionItemPtr > &getReplacedBy() const noexcept { return replacedBy; }
- void addReplacedBy(TransactionItemPtr value) { replacedBy.push_back(value); }
+ void addReplacedBy(TransactionItemPtr value) { if (value) replacedBy.push_back(value); }
void save();
void saveReplacedBy();
--
libgit2 0.26.6

View File

@ -31,11 +31,13 @@
Name: libdnf Name: libdnf
Version: 0.22.0 Version: 0.22.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: Library providing simplified C and Python API to libsolv Summary: Library providing simplified C and Python API to libsolv
License: LGPLv2+ License: LGPLv2+
URL: https://github.com/rpm-software-management/libdnf URL: https://github.com/rpm-software-management/libdnf
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch0001: 0001-Modify-solver_describe_decision-to-report-cleaned-RhBug1486749.patch
Patch0002: 0002-history-Fix-crash-in-TransactionItemaddReplacedBy.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc BuildRequires: gcc
@ -243,6 +245,10 @@ popd
%endif %endif
%changelog %changelog
* Wed Oct 15 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.0-2
- backport Modify-solver_describe_decision-to-report-cleaned-RhBug1486749
- backport history-Fix-crash-in-TransactionItemaddReplacedBy
* Mon Oct 15 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.0-1 * Mon Oct 15 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.22.0-1
- Update to 0.22.0 - Update to 0.22.0
- Fix segfault in repo_internalize_trigger (RhBug:1375895) - Fix segfault in repo_internalize_trigger (RhBug:1375895)