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

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