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

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