summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-08-23 08:11:52 +0000
committerZac Medico <zmedico@gentoo.org>2007-08-23 08:11:52 +0000
commit8e504594a5567a003394f7bc99ca9d0fa3badb24 (patch)
tree1fc92e54836e0558a048703a4166d129ed4d99dd /bin
parentdc3bb50020a6e9af8ca8542f986cccc00978a770 (diff)
downloadportage-8e504594a5567a003394f7bc99ca9d0fa3badb24.tar.gz
portage-8e504594a5567a003394f7bc99ca9d0fa3badb24.tar.bz2
portage-8e504594a5567a003394f7bc99ca9d0fa3badb24.zip
Make depgraph.create() avoid metadata lookups for binary packages and ebuilds in cases where an installed package has already been added to the graph. This greatly improves performance when the graph contains a large number of installed packages. (trunk r7680)
svn path=/main/branches/2.1.2/; revision=7681
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge13
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/emerge b/bin/emerge
index d9ffaf36d..182180f6a 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1821,16 +1821,19 @@ class depgraph:
myeb_matches = portdb.xmatch("match-visible", x)
myeb = None
ebuild_merge_node = None
+ installed_node = None
if myeb_matches and \
"--usepkgonly" not in self.myopts:
myeb = portage.best(myeb_matches)
ebuild_merge_node = ("ebuild", myroot, myeb, "merge")
+ installed_node = ("installed", myroot, myeb, "nomerge")
myeb_pkg=None
binary_merge_node = None
if "--usepkg" in self.myopts and \
not (ebuild_merge_node and \
- self.digraph.contains(ebuild_merge_node)):
+ (self.digraph.contains(ebuild_merge_node) or \
+ self.digraph.contains(installed_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)
@@ -1880,17 +1883,23 @@ class depgraph:
if "--usepkgonly" not in self.myopts and myeb_matches:
mydb = portdb
+ mytype = "ebuild"
if self.digraph.contains(ebuild_merge_node) and \
ebuild_merge_node not in self._slot_collision_nodes:
# reuse cached metadata
mydb = self.mydbapi[myroot]
+ elif self.digraph.contains(installed_node) and \
+ installed_node not in self._slot_collision_nodes:
+ # reuse cached metadata
+ mydb = self.mydbapi[myroot]
+ mytype = "installed"
metadata = dict(izip(self._mydbapi_keys,
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))
+ ([mytype, myroot, myeb], metadata))
if not matched_packages and \
not (arg and "selective" not in self.myparams):