summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-10 06:34:52 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-10 06:34:52 +0000
commit4e2525b656c90531ba080209e85930b2d5fa89b5 (patch)
treefacf750ba0c4bd339c7fba70e463b09ad3f3dfac
parent6cc00751a75964949277484ebe1a437c5278c532 (diff)
downloadportage-4e2525b656c90531ba080209e85930b2d5fa89b5.tar.gz
portage-4e2525b656c90531ba080209e85930b2d5fa89b5.tar.bz2
portage-4e2525b656c90531ba080209e85930b2d5fa89b5.zip
Use cached Package instances in depgraph.display().
svn path=/main/trunk/; revision=9794
-rw-r--r--pym/_emerge/__init__.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 30df7cb4d..0e5a64f9d 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -3692,7 +3692,6 @@ class depgraph(object):
for mylist_index in xrange(len(mylist)):
x, depth, ordered = mylist[mylist_index]
- pkg_node = tuple(x)
pkg_type = x[0]
myroot = x[1]
pkg_key = x[2]
@@ -3724,17 +3723,16 @@ class depgraph(object):
addl += bad(" (is blocking %s)") % block_parents
blockers.append(addl)
else:
+ pkg = self._pkg_cache[tuple(x)]
+ metadata = pkg.metadata
pkg_status = x[3]
pkg_merge = ordered and pkg_status != "nomerge"
- if pkg_node in self._slot_collision_nodes or \
- (pkg_status == "nomerge" and pkg_type != "installed"):
+ if pkg in self._slot_collision_nodes or pkg.onlydeps:
# The metadata isn't cached due to a slot collision or
# --onlydeps.
mydbapi = self.trees[myroot][self.pkg_tree_map[pkg_type]].dbapi
else:
mydbapi = self.mydbapi[myroot] # contains cached metadata
- metadata = dict(izip(self._mydbapi_keys,
- mydbapi.aux_get(pkg_key, self._mydbapi_keys)))
ebuild_path = None
repo_name = metadata["repository"]
built = pkg_type != "ebuild"
@@ -3745,13 +3743,8 @@ class depgraph(object):
raise portage.exception.PackageNotFound(pkg_key)
repo_path_real = os.path.dirname(os.path.dirname(
os.path.dirname(ebuild_path)))
- pkgsettings.setcpv(pkg_key, mydb=mydbapi)
- metadata["USE"] = pkgsettings["PORTAGE_USE"]
else:
repo_path_real = portdb.getRepositoryPath(repo_name)
- pkg_node = Package(type_name=pkg_type, root=myroot,
- cpv=pkg_key, built=built, installed=installed,
- metadata=metadata)
pkg_use = metadata["USE"].split()
try:
restrict = flatten(use_reduce(paren_reduce(
@@ -3901,7 +3894,7 @@ class depgraph(object):
# Prevent USE_EXPAND_HIDDEN flags from being hidden if they
# are the only thing that triggered reinstallation.
reinst_flags_map = {}
- reinstall_for_flags = self._reinstall_nodes.get(pkg_node)
+ reinstall_for_flags = self._reinstall_nodes.get(pkg)
reinst_expand_map = None
if reinstall_for_flags:
reinst_flags_map = map_to_use_expand(