summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-05 22:42:16 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-05 22:42:16 +0000
commit81ec22fe6a05bae56e9585f4d6a128f3d79d815a (patch)
tree6b08a353e3387a5409b9238903ece467c23229f5
parentf291576504956169153005d0b227b5983c0ba76a (diff)
downloadportage-81ec22fe6a05bae56e9585f4d6a128f3d79d815a.tar.gz
portage-81ec22fe6a05bae56e9585f4d6a128f3d79d815a.tar.bz2
portage-81ec22fe6a05bae56e9585f4d6a128f3d79d815a.zip
Allow multislot packages to be added to the world file
via --noreplace. Having these atoms in the world file will trigger recommendations to run emaint in some cases, like when running `emerge -e world`. The atoms need to be in the world file to prevent multislot packages from being removed by --depclean though. svn path=/main/trunk/; revision=8436
-rw-r--r--pym/_emerge/__init__.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 0eb66250e..933c4ce9b 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -633,15 +633,17 @@ def create_world_atom(pkg_key, metadata, args_set, root_config):
slot_atom = "%s:%s" % (cp, metadata["SLOT"])
# First verify the slot is in the portage tree to avoid
# adding a bogus slot like that produced by multislot.
- if portdb.match(slot_atom):
- # Now verify that the argument is precise enough to identify a
- # specific slot.
- matches = portdb.match(arg_atom)
- matched_slots = set()
- for cpv in matches:
- matched_slots.add(portdb.aux_get(cpv, ["SLOT"])[0])
- if len(matched_slots) == 1:
- new_world_atom = slot_atom
+ mydb = portdb
+ if not portdb.match(slot_atom):
+ mydb = vardb
+ # Now verify that the argument is precise
+ # enough to identify a specific slot.
+ matches = mydb.match(arg_atom)
+ matched_slots = set()
+ for cpv in matches:
+ matched_slots.add(mydb.aux_get(cpv, ["SLOT"])[0])
+ if len(matched_slots) == 1:
+ new_world_atom = slot_atom
if new_world_atom == sets["world"].findAtomForPackage(pkg_key, metadata):
# Both atoms would be identical, so there's nothing to add.
return None