summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-31 20:02:58 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-31 20:02:58 +0000
commit518881b9d26d6a2ed987d6870ec2fe088f977676 (patch)
treecf2698ec07d247b41e221b8123732bfc491ec739
parent47c06af79ab21ad40ac8a56205ac0069d1ca9239 (diff)
downloadportage-518881b9d26d6a2ed987d6870ec2fe088f977676.tar.gz
portage-518881b9d26d6a2ed987d6870ec2fe088f977676.tar.bz2
portage-518881b9d26d6a2ed987d6870ec2fe088f977676.zip
Fix create_world_atom() to take a Package instance in it's arguments.
svn path=/main/trunk/; revision=10521
-rw-r--r--pym/_emerge/__init__.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 8a73156e9..c0bcdda0d 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -736,15 +736,14 @@ class RootConfig(object):
self.sets = self.setconfig.getSets()
self.visible_pkgs = PackageVirtualDbapi(self.settings)
-def create_world_atom(pkg_key, metadata, args_set, root_config):
+def create_world_atom(pkg, args_set, root_config):
"""Create a new atom for the world file if one does not exist. If the
argument atom is precise enough to identify a specific slot then a slot
atom will be returned. Atoms that are in the system set may also be stored
in world since system atoms can only match one slot while world atoms can
be greedy with respect to slots. Unslotted system packages will not be
stored in world."""
- pkg = Package(cpv=pkg_key, root_config=root_config, metadata=metadata)
- metadata = pkg.metadata
+
arg_atom = args_set.findAtomForPackage(pkg)
if not arg_atom:
return None
@@ -766,7 +765,7 @@ def create_world_atom(pkg_key, metadata, args_set, root_config):
if slotted and arg_atom != cp:
# If the user gave a specific atom, store it as a
# slot atom in the world file.
- slot_atom = "%s:%s" % (cp, metadata["SLOT"])
+ slot_atom = pkg.slot_atom
# For USE=multislot, there are a couple of cases to
# handle here:
@@ -4928,8 +4927,7 @@ class depgraph(object):
myroot == self.target_root and \
favorites_set.findAtomForPackage(pkg):
# Maybe it will be added to world now.
- if create_world_atom(pkg_key, metadata,
- favorites_set, root_config):
+ if create_world_atom(pkg, favorites_set, root_config):
pkg_world = True
except portage.exception.InvalidDependString:
# This is reported elsewhere if relevant.
@@ -5228,10 +5226,9 @@ class depgraph(object):
pkg_type, root, pkg_key, pkg_status = x
if pkg_status != "nomerge":
continue
- metadata = x.metadata
+
try:
- myfavkey = create_world_atom(pkg_key, metadata,
- args_set, root_config)
+ myfavkey = create_world_atom(pkg, args_set, root_config)
if myfavkey:
if myfavkey in added_favorites:
continue
@@ -6178,8 +6175,7 @@ class MergeTask(object):
args_set.findAtomForPackage(pkg):
world_set.lock()
world_set.load() # maybe it's changed on disk
- myfavkey = create_world_atom(pkg_key, metadata,
- args_set, root_config)
+ myfavkey = create_world_atom(pkg, args_set, root_config)
if myfavkey:
print ">>> Recording",myfavkey,"in \"world\" favorites file..."
emergelog(xterm_titles, " === ("+\