Blame SOURCES/0010-Honor-priority-with-check-update-RhBug1769466.patch

8c93e6
From 505e534817d076c5190b211983a8a2c930cbe560 Mon Sep 17 00:00:00 2001
8c93e6
From: Jaroslav Mracek <jmracek@redhat.com>
8c93e6
Date: Mon, 16 Dec 2019 11:14:33 +0100
8c93e6
Subject: [PATCH] Honor priority with check-update (RhBug:1769466)
8c93e6
8c93e6
Check update is going to use the new query filter that honors repo
8c93e6
priority.
8c93e6
8c93e6
https://bugzilla.redhat.com/show_bug.cgi?id=1769466
8c93e6
---
8c93e6
 dnf.spec                     | 2 +-
8c93e6
 dnf/base.py                  | 4 ++--
8c93e6
 dnf/cli/commands/__init__.py | 2 +-
8c93e6
 3 files changed, 4 insertions(+), 4 deletions(-)
8c93e6
8c93e6
diff --git a/dnf.spec b/dnf.spec
8c93e6
index e20be1e241..57bfd778d4 100644
8c93e6
--- a/dnf.spec
8c93e6
+++ b/dnf.spec
8c93e6
@@ -1,5 +1,5 @@
8c93e6
 # default dependencies
8c93e6
-%global hawkey_version 0.39.1
8c93e6
+%global hawkey_version 0.41.0
8c93e6
 %global libcomps_version 0.1.8
8c93e6
 %global libmodulemd_version 1.4.0
8c93e6
 %global rpm_version 4.14.0
8c93e6
diff --git a/dnf/base.py b/dnf/base.py
8c93e6
index c4ea04181a..1ed01c37a9 100644
8c93e6
--- a/dnf/base.py
8c93e6
+++ b/dnf/base.py
8c93e6
@@ -1365,7 +1365,7 @@ def query_for_repo(query):
8c93e6
 
8c93e6
         # produce the updates list of tuples
8c93e6
         elif pkgnarrow == 'upgrades':
8c93e6
-            updates = query_for_repo(q).upgrades()
8c93e6
+            updates = query_for_repo(q).filterm(upgrades_by_priority=True)
8c93e6
             # reduce a query to security upgrades if they are specified
8c93e6
             updates = self._merge_update_filters(updates)
8c93e6
             # reduce a query to latest packages
8c93e6
@@ -1417,7 +1417,7 @@ def query_for_repo(query):
8c93e6
         elif pkgnarrow == 'obsoletes':
8c93e6
             inst = q.installed()
8c93e6
             obsoletes = query_for_repo(
8c93e6
-                self.sack.query()).filter(obsoletes=inst)
8c93e6
+                self.sack.query()).filter(obsoletes_by_priority=inst)
8c93e6
             # reduce a query to security upgrades if they are specified
8c93e6
             obsoletes = self._merge_update_filters(obsoletes, warning=False)
8c93e6
             obsoletesTuples = []
8c93e6
diff --git a/dnf/cli/commands/__init__.py b/dnf/cli/commands/__init__.py
8c93e6
index 2a0726b654..d71a97f910 100644
8c93e6
--- a/dnf/cli/commands/__init__.py
8c93e6
+++ b/dnf/cli/commands/__init__.py
8c93e6
@@ -279,7 +279,7 @@ def configure(self):
8c93e6
         _checkEnabledRepo(self.base)
8c93e6
 
8c93e6
     def run(self):
8c93e6
-        query = self.base.sack.query().upgrades()
8c93e6
+        query = self.base.sack.query().filterm(upgrades_by_priority=True)
8c93e6
         if self.base.conf.obsoletes:
8c93e6
             obsoleted = query.union(self.base.sack.query().installed())
8c93e6
             obsoletes = self.base.sack.query().filter(obsoletes=obsoleted)