Don't choose src packages for installation

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
This commit is contained in:
Igor Gnatenko 2017-05-04 15:19:25 +02:00
parent a5794084dc
commit 9087cf58a8
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From fa5541bce749bc5e7a36913d3bf0ffb19b499fb8 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Wed, 3 May 2017 09:52:41 +0200
Subject: [PATCH] Filter out src for get_best_selector
Closes: #799
Approved by: ignatenkobrain
---
dnf/subject.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dnf/subject.py b/dnf/subject.py
index d4834c08..cb754ce2 100644
--- a/dnf/subject.py
+++ b/dnf/subject.py
@@ -128,9 +128,11 @@ class Subject(object):
solution = self._get_nevra_solution(sack, forms=forms)
if solution['query']:
q = solution['query']
+ q = q.filter(arch__neq="src")
if obsoletes and solution['nevra'] and solution['nevra']._has_just_name():
q = q.union(sack.query().filter(obsoletes=q))
- return sltr.set(pkg=q)
+ if q:
+ return sltr.set(pkg=q)
return sltr
--
2.12.2

View File

@ -25,7 +25,7 @@
Name: dnf
Version: 2.4.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ and GPLv2 and GPL
@ -34,6 +34,7 @@ URL: https://github.com/rpm-software-management/dnf
# cd dnf
# tito build --tgz --tag=dnf-2.0.1-1
Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-Filter-out-src-for-get_best_selector.patch
BuildArch: noarch
BuildRequires: cmake
BuildRequires: gettext
@ -332,6 +333,9 @@ popd
%endif
%changelog
* Thu May 04 2017 Igor Gnatenko <ignatenko@redhat.com> - 2.4.0-2
- Don't choose src packages for installation
* Tue May 02 2017 Jaroslav Mracek <jmracek@redhat.com> 2.4.0-1
- po: Update translations (Igor Gnatenko)
- po: Update translations (Igor Gnatenko)