Blame SOURCES/BZ-1480065-depsolve-filter-conflicting-provider.patch

5e9bef
commit ae2d51ba77db4a4855912d9c33565ef2f4203803
5e9bef
Author: Michal Domonkos <mdomonko@redhat.com>
5e9bef
Date:   Wed Jun 20 17:43:44 2018 +0200
5e9bef
5e9bef
    depsolve: filter out conflicting provider. BZ 1480065
5e9bef
    
5e9bef
    When there are multiple providers available for a requirement, yum would
5e9bef
    happily pick the one that the requiring package also has a "Conflicts:"
5e9bef
    on (via another virtual provide), failing to resolve the transaction.
5e9bef
    
5e9bef
    Example:
5e9bef
    - foo requires bar and conflicts my-bar
5e9bef
    - bax provides bar
5e9bef
    - bay provides bar, my-bar
5e9bef
    
5e9bef
    Yum might decide to pick bay, only to fail due to the conflict with foo
5e9bef
    later in the process.
5e9bef
    
5e9bef
    This commit fixes that by dropping such a provider from the candidate
5e9bef
    list when depsolving.
5e9bef
5e9bef
diff --git a/yum/depsolve.py b/yum/depsolve.py
5e9bef
index 3453456c..26369b7b 100644
5e9bef
--- a/yum/depsolve.py
5e9bef
+++ b/yum/depsolve.py
5e9bef
@@ -1556,6 +1556,13 @@ class Depsolve(object):
5e9bef
                 continue
5e9bef
             unique_nevra_pkgs[pkg.pkgtup] = pkg
5e9bef
         pkgs = unique_nevra_pkgs.values()
5e9bef
+
5e9bef
+        # Do a conflict filtering; get rid of those pkgs that reqpo conflicts
5e9bef
+        # with
5e9bef
+        if reqpo is not None:
5e9bef
+            pkgs = [pkg for pkg in pkgs
5e9bef
+                        if not any(pkg.checkPrco('provides', conflict)
5e9bef
+                                   for conflict in reqpo.conflicts)]
5e9bef
             
5e9bef
         pkgresults = {}
5e9bef