summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-06-27 10:19:36 -0700
committerZac Medico <zmedico@gentoo.org>2012-06-27 10:19:36 -0700
commitbb112d9e0e0e9fb60cbe713887ab88454d5943fe (patch)
tree74e3a2a64c446485420dbb11e5f86ce44dc8d418 /pym/_emerge
parent21ef745c11538e294f0946f2a40812971652b40c (diff)
downloadportage-bb112d9e0e0e9fb60cbe713887ab88454d5943fe.tar.gz
portage-bb112d9e0e0e9fb60cbe713887ab88454d5943fe.tar.bz2
portage-bb112d9e0e0e9fb60cbe713887ab88454d5943fe.zip
slot_conflict_handler: handle slot_abi
We have to distinguish this from the "version" conflict, in order to avoid invalid vercmp calls when there's not version.
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/resolver/slot_collision.py44
1 files changed, 30 insertions, 14 deletions
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index a1c87146c..783a6483d 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -275,19 +275,29 @@ class slot_conflict_handler(object):
if not atom_without_use_set.findAtomForPackage(other_pkg, \
modified_use=_pkg_use_enabled(other_pkg)):
- #The version range does not match.
- sub_type = None
- if atom.operator in (">=", ">"):
- sub_type = "ge"
- elif atom.operator in ("=", "~"):
- sub_type = "eq"
- elif atom.operator in ("<=", "<"):
- sub_type = "le"
-
- atoms = collision_reasons.get(("version", sub_type), set())
- atoms.add((ppkg, atom, other_pkg))
- num_all_specific_atoms += 1
- collision_reasons[("version", sub_type)] = atoms
+ if atom.operator is not None:
+ # The version range does not match.
+ sub_type = None
+ if atom.operator in (">=", ">"):
+ sub_type = "ge"
+ elif atom.operator in ("=", "~"):
+ sub_type = "eq"
+ elif atom.operator in ("<=", "<"):
+ sub_type = "le"
+
+ key = ("version", sub_type)
+ atoms = collision_reasons.get(key, set())
+ atoms.add((ppkg, atom, other_pkg))
+ num_all_specific_atoms += 1
+ collision_reasons[key] = atoms
+ else:
+ # The slot_abi does not match.
+ key = ("sub-slot", atom.slot_abi)
+ atoms = collision_reasons.get(key, set())
+ atoms.add((ppkg, atom, other_pkg))
+ num_all_specific_atoms += 1
+ collision_reasons[key] = atoms
+
elif not atom_set.findAtomForPackage(other_pkg, \
modified_use=_pkg_use_enabled(other_pkg)):
missing_iuse = other_pkg.iuse.get_missing_iuse(
@@ -333,6 +343,9 @@ class slot_conflict_handler(object):
else:
best_matches[atom.cp] = (ppkg, atom)
selected_for_display.update(best_matches.values())
+ elif type == "sub-slot":
+ for ppkg, atom, other_pkg in parents:
+ selected_for_display.add((ppkg, atom))
elif type == "use":
#Prefer atoms with unconditional use deps over, because it's
#not possible to change them on the parent, which means there
@@ -437,19 +450,22 @@ class slot_conflict_handler(object):
# Display the specific atom from SetArg or
# Package types.
version_violated = False
+ sub_slot_violated = False
use = []
for (type, sub_type), parents in collision_reasons.items():
for x in parents:
if parent == x[0] and atom == x[1]:
if type == "version":
version_violated = True
+ elif type == "sub-slot":
+ sub_slot_violated = True
elif type == "use":
use.append(sub_type)
break
atom_str = highlight_violations(atom.unevaluated_atom, version_violated, use)
- if version_violated:
+ if version_violated or sub_slot_violated:
self.is_a_version_conflict = True
msg.append("%s required by %s" % (atom_str, parent))