From: Zac Medico Date: Wed, 22 Aug 2007 21:42:52 +0000 (-0000) Subject: Make depgraph.select_dep() reuse cached metadata from nodes that have already been... X-Git-Tag: v2.1.3.9~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ee09a98c8553f9aa12700a33ae89d6b9ffeaec1;p=portage.git 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 --- 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))