From ff8dfe3dd9ffbcd5f6037fe9a690bd1e1755e9a1 Mon Sep 17 00:00:00 2001 From: Pavla Kratochvilova Date: Thu, 7 Nov 2019 13:15:48 +0100 Subject: [PATCH] Backport fix for accidental code removal from hy_subject_get_best_solution() --- ...-src-in-hy_subject_get_best_solution.patch | 23 +++++++++++++++++++ libdnf.spec | 7 +++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 0003-Fix-use-with-src-in-hy_subject_get_best_solution.patch diff --git a/0003-Fix-use-with-src-in-hy_subject_get_best_solution.patch b/0003-Fix-use-with-src-in-hy_subject_get_best_solution.patch new file mode 100644 index 0000000..9e8e989 --- /dev/null +++ b/0003-Fix-use-with-src-in-hy_subject_get_best_solution.patch @@ -0,0 +1,23 @@ +From c0fb150c79302079a4fb4e26fec26cecbeefd84f Mon Sep 17 00:00:00 2001 +From: Jaroslav Rohel +Date: Thu, 7 Nov 2019 09:53:54 +0100 +Subject: [PATCH] Fix: use with_src in hy_subject_get_best_solution() + +The code accidentally disappeared during improving getBestSolution(). +--- + libdnf/hy-subject.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libdnf/hy-subject.cpp b/libdnf/hy-subject.cpp +index 686438d3b..c90fa148d 100644 +--- a/libdnf/hy-subject.cpp ++++ b/libdnf/hy-subject.cpp +@@ -81,6 +81,8 @@ hy_subject_get_best_solution(HySubject subject, DnfSack *sack, HyForm *forms, Hy + gboolean with_filenames, gboolean with_src) + { + std::unique_ptr query(new libdnf::Query(sack, libdnf::Query::ExcludeFlags::APPLY_EXCLUDES)); ++ if (!with_src) ++ query->addFilter(HY_PKG_ARCH, HY_NEQ, "src"); + auto ret = query->filterSubject(subject, forms, icase, with_nevra, with_provides, with_filenames); + *out_nevra = ret.second.release(); + return query.release(); diff --git a/libdnf.spec b/libdnf.spec index e0c7a52..8403c5a 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -49,13 +49,15 @@ Name: libdnf Version: 0.37.2 -Release: 1%{?dist} +Release: 2%{?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 Patch0001: 0001-Revert-hy_detect_arch-detect-crypto-only-on-arm-vers.patch Patch0002: 0002-Fix-Arm-detection-improvements.patch +# https://github.com/rpm-software-management/libdnf/pull/836 +Patch0003: 0003-Fix-use-with-src-in-hy_subject_get_best_solution.patch BuildRequires: cmake BuildRequires: gcc @@ -292,6 +294,9 @@ popd %endif %changelog +* Wed Nov 13 2019 Pavla Kratochvilova - 0.37.2-2 +- Fix accidental code removal from hy_subject_get_best_solution() + * Wed Nov 06 2019 Pavla Kratochvilova - 0.37.2-1 - Update to 0.37.2 - Use more descriptive message when failed to retrieve GPG key (RhBug:1605117)