Skip to content

Commit ae2d51b

Browse files
committed
depsolve: filter out conflicting provider. BZ 1480065
When there are multiple providers available for a requirement, yum would happily pick the one that the requiring package also has a "Conflicts:" on (via another virtual provide), failing to resolve the transaction. Example: - foo requires bar and conflicts my-bar - bax provides bar - bay provides bar, my-bar Yum might decide to pick bay, only to fail due to the conflict with foo later in the process. This commit fixes that by dropping such a provider from the candidate list when depsolving.
1 parent 1222f37 commit ae2d51b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

yum/depsolve.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,13 @@ def _pkg2prov_version(pkg, provname):
15561556
continue
15571557
unique_nevra_pkgs[pkg.pkgtup] = pkg
15581558
pkgs = unique_nevra_pkgs.values()
1559+
1560+
# Do a conflict filtering; get rid of those pkgs that reqpo conflicts
1561+
# with
1562+
if reqpo is not None:
1563+
pkgs = [pkg for pkg in pkgs
1564+
if not any(pkg.checkPrco('provides', conflict)
1565+
for conflict in reqpo.conflicts)]
15591566

15601567
pkgresults = {}
15611568

0 commit comments

Comments
 (0)