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

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