Backport fix for accidental code removal from hy_subject_get_best_solution()

This commit is contained in:
Pavla Kratochvilova 2019-11-07 13:15:48 +01:00
parent ba1a75e45d
commit ff8dfe3dd9
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,23 @@
From c0fb150c79302079a4fb4e26fec26cecbeefd84f Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
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<libdnf::Query> 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();

View File

@ -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 <pkratoch@redhat.com> - 0.37.2-2
- Fix accidental code removal from hy_subject_get_best_solution()
* Wed Nov 06 2019 Pavla Kratochvilova <pkratoch@redhat.com> - 0.37.2-1
- Update to 0.37.2
- Use more descriptive message when failed to retrieve GPG key (RhBug:1605117)