Blame SOURCES/0001-versionlock-Do-not-exclude-locked-obsoleters-RhBug1957280.patch

ca81c9
From a3b9e17628994b43080b8c03b9f665a0e6514cd6 Mon Sep 17 00:00:00 2001
ca81c9
From: Marek Blaha <mblaha@redhat.com>
ca81c9
Date: Tue, 11 May 2021 08:29:31 +0200
ca81c9
Subject: [PATCH] versionlock: Do not exclude locked obsoleters (RhBug:1957280)
ca81c9
ca81c9
The versionlock plugin excludes all obsoleters of locked packages. If
ca81c9
both versions (obsoleted package and its obsoleter) are locked, this
ca81c9
leads to the inability to install the obsoleter package. The patch
ca81c9
protects all locked packages from being excluded as obsoleters.
ca81c9
ca81c9
= changelog =
ca81c9
msg:           versionlock: Locking obsoleted package does not make the obsoleter unavailable
ca81c9
type:          bugfix
ca81c9
resolves:      https://bugzilla.redhat.com/show_bug.cgi?id=1957280
ca81c9
---
ca81c9
 plugins/versionlock.py | 6 ++++--
ca81c9
 1 file changed, 4 insertions(+), 2 deletions(-)
ca81c9
ca81c9
diff --git a/plugins/versionlock.py b/plugins/versionlock.py
ca81c9
index d997130..c89a75d 100644
ca81c9
--- a/plugins/versionlock.py
ca81c9
+++ b/plugins/versionlock.py
ca81c9
@@ -113,8 +113,10 @@ class VersionLock(dnf.Plugin):
ca81c9
             other_versions = all_versions.difference(locked_query)
ca81c9
             excludes_query = excludes_query.union(other_versions)
ca81c9
             # exclude also anything that obsoletes the locked versions of packages
ca81c9
-            excludes_query = excludes_query.union(
ca81c9
-                self.base.sack.query().filterm(obsoletes=locked_query))
ca81c9
+            obsoletes_query = self.base.sack.query().filterm(obsoletes=locked_query)
ca81c9
+            # leave out obsoleters that are also part of locked versions (otherwise the obsoleter package
ca81c9
+            # would not be installable at all)
ca81c9
+            excludes_query = excludes_query.union(obsoletes_query.difference(locked_query))
ca81c9
 
ca81c9
         excludes_query.filterm(reponame__neq=hawkey.SYSTEM_REPO_NAME)
ca81c9
         if excludes_query:
ca81c9
--
ca81c9
libgit2 1.0.1
ca81c9