summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-08-22 21:42:52 +0000
committerZac Medico <zmedico@gentoo.org>2007-08-22 21:42:52 +0000
commit7ee09a98c8553f9aa12700a33ae89d6b9ffeaec1 (patch)
tree07c93388dbeeeefc736a97faafa21217387cdcd8
parenteb2f7b1014324d36e1ce1543cc9c06c918c3e703 (diff)
downloadportage-7ee09a98c8553f9aa12700a33ae89d6b9ffeaec1.tar.gz
portage-7ee09a98c8553f9aa12700a33ae89d6b9ffeaec1.tar.bz2
portage-7ee09a98c8553f9aa12700a33ae89d6b9ffeaec1.zip
Make depgraph.select_dep() reuse cached metadata from nodes that have already been added to the graph. (trunk r7666)
svn path=/main/branches/2.1.2/; revision=7670
-rwxr-xr-xbin/emerge31
1 files changed, 25 insertions, 6 deletions
diff --git a/bin/emerge b/bin/emerge
index 09d46ac22..c2613ba70 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1820,11 +1820,17 @@ class depgraph:
matched_packages = []
myeb_matches = portdb.xmatch("match-visible", x)
myeb = None
- if "--usepkgonly" not in self.myopts:
+ ebuild_merge_node = None
+ if myeb_matches and \
+ "--usepkgonly" not in self.myopts:
myeb = portage.best(myeb_matches)
+ ebuild_merge_node = ("ebuild", myroot, myeb, "merge")
myeb_pkg=None
- if "--usepkg" in self.myopts:
+ binary_merge_node = None
+ if "--usepkg" in self.myopts and \
+ not (ebuild_merge_node and \
+ self.digraph.contains(ebuild_merge_node)):
# The next line assumes the binarytree has been populated.
# XXX: Need to work out how we use the binary tree with roots.
myeb_pkg_matches = bindb.match(x)
@@ -1835,10 +1841,17 @@ class depgraph:
not portdb.cpv_exists(pkg)]
if myeb_pkg_matches:
myeb_pkg = portage.best(myeb_pkg_matches)
+ mydb = bindb
+ binary_merge_node = ("binary", myroot, myeb_pkg, "merge")
+ if self.digraph.contains(binary_merge_node) and \
+ binary_merge_node not in self._slot_collision_nodes:
+ # reuse cached metadata
+ mydb = self.mydbapi[myroot]
metadata = dict(izip(self._mydbapi_keys,
- bindb.aux_get(myeb_pkg, self._mydbapi_keys)))
+ mydb.aux_get(myeb_pkg, self._mydbapi_keys)))
if myeb_pkg and \
+ not self.digraph.contains(binary_merge_node) and \
("--newuse" in self.myopts or \
"--reinstall" in self.myopts):
iuses = set(filter_iuse_defaults(metadata["IUSE"].split()))
@@ -1866,10 +1879,16 @@ class depgraph:
(["binary", myroot, myeb_pkg], metadata))
if "--usepkgonly" not in self.myopts and myeb_matches:
+ mydb = portdb
+ if self.digraph.contains(ebuild_merge_node) and \
+ ebuild_merge_node not in self._slot_collision_nodes:
+ # reuse cached metadata
+ mydb = self.mydbapi[myroot]
metadata = dict(izip(self._mydbapi_keys,
- portdb.aux_get(myeb, self._mydbapi_keys)))
- pkgsettings.setcpv(myeb, mydb=portdb)
- metadata["USE"] = pkgsettings["USE"]
+ mydb.aux_get(myeb, self._mydbapi_keys)))
+ if mydb is portdb:
+ pkgsettings.setcpv(myeb, mydb=portdb)
+ metadata["USE"] = pkgsettings["USE"]
matched_packages.append(
(["ebuild", myroot, myeb], metadata))