diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-12-12 02:22:14 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-12-12 02:22:14 +0000 |
commit | 3714f1aa2be08ff9f5c8da9a1d185dc0b704eb65 (patch) | |
tree | b93f48c347972d1b752488a94e2a68f43d484285 | |
parent | b7c8c3fc46f1953853549d2a5abfcf66b575abc4 (diff) | |
download | portage-3714f1aa2be08ff9f5c8da9a1d185dc0b704eb65.tar.gz portage-3714f1aa2be08ff9f5c8da9a1d185dc0b704eb65.tar.bz2 portage-3714f1aa2be08ff9f5c8da9a1d185dc0b704eb65.zip |
Optimize dep_check calls in depgraph.validate_blockers() by using a fakedbapi instance instead of the real pordbapi (minimizes available matches).
svn path=/main/trunk/; revision=5277
-rwxr-xr-x | bin/emerge | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/emerge b/bin/emerge index ac569b9b1..048c4abb7 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1472,6 +1472,19 @@ class depgraph: # been pulled into the depgraph. This is not enabled by default # due to the performance penalty that is incurred by all the # additional dep_check calls that are required. + + # Optimization hack for dep_check calls that minimizes the + # available matches by replacing the portdb with a fakedbapi + # instance. + class FakePortageTree(object): + def __init__(self, mydb): + self.dbapi = mydb + dep_check_trees = {} + for myroot in self.trees: + dep_check_trees[myroot] = self.trees[myroot].copy() + dep_check_trees[myroot]["porttree"] = \ + FakePortageTree(self.mydbapi[myroot]) + dep_keys = ["DEPEND","RDEPEND","PDEPEND"] for myroot in self.trees: pkg_node_map = self.pkg_node_map[myroot] @@ -1494,7 +1507,7 @@ class depgraph: # optimize dep_check calls by eliminating atoms via # dep_wordreduce and dep_eval calls. success, atoms = portage.dep_check(depstr, final_db, - pkgsettings, myuse=myuse, trees=self.trees, + pkgsettings, myuse=myuse, trees=dep_check_trees, myroot=myroot) if not success: print "\n\n" |