diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-01 22:24:23 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-01 22:24:23 +0000 |
commit | 5f52aad4c25dfd7c1b15af89b8d102bc40cba3dc (patch) | |
tree | 0e612d6340a92ea842f7e4f05f7b2722862e7c58 | |
parent | 4c20e68c48773765e6b6fc18d42523a423d62a76 (diff) | |
download | portage-5f52aad4c25dfd7c1b15af89b8d102bc40cba3dc.tar.gz portage-5f52aad4c25dfd7c1b15af89b8d102bc40cba3dc.tar.bz2 portage-5f52aad4c25dfd7c1b15af89b8d102bc40cba3dc.zip |
Move FakeVartree population out of the constructor by calling the sync()
method explicitly. This allows the depgraph constructor avoid populating
the FakeVartree, and delay it until depgraph._load_vdb() is called.
svn path=/main/trunk/; revision=14773
-rw-r--r-- | pym/_emerge/BlockerDB.py | 6 | ||||
-rw-r--r-- | pym/_emerge/FakeVartree.py | 7 | ||||
-rw-r--r-- | pym/_emerge/depgraph.py | 6 |
3 files changed, 10 insertions, 9 deletions
diff --git a/pym/_emerge/BlockerDB.py b/pym/_emerge/BlockerDB.py index 8367ec651..f4ff9cc2c 100644 --- a/pym/_emerge/BlockerDB.py +++ b/pym/_emerge/BlockerDB.py @@ -29,15 +29,13 @@ class BlockerDB(object): def _get_fake_vartree(self, acquire_lock=0): fake_vartree = self._fake_vartree if fake_vartree is None: - fake_vartree = FakeVartree(self._root_config, - acquire_lock=acquire_lock) + fake_vartree = FakeVartree(self._root_config) self._fake_vartree = fake_vartree self._dep_check_trees = { self._vartree.root : { "porttree" : fake_vartree, "vartree" : fake_vartree, }} - else: - fake_vartree.sync(acquire_lock=acquire_lock) + fake_vartree.sync(acquire_lock=acquire_lock) return fake_vartree def findInstalledBlockers(self, new_pkg, acquire_lock=0): diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py index 07703f3f2..e1b819809 100644 --- a/pym/_emerge/FakeVartree.py +++ b/pym/_emerge/FakeVartree.py @@ -21,8 +21,9 @@ class FakeVartree(portage.vartree): allows things like vardb global updates to be done in memory so that the user doesn't necessarily need write access to the vardb in cases where global updates are necessary (updates are performed when necessary if there - is not a matching ebuild in the tree).""" - def __init__(self, root_config, pkg_cache=None, acquire_lock=1): + is not a matching ebuild in the tree). Instances of this class are not + populated until the sync() method is called.""" + def __init__(self, root_config, pkg_cache=None): self._root_config = root_config if pkg_cache is None: pkg_cache = {} @@ -49,8 +50,6 @@ class FakeVartree(portage.vartree): self._portdb = portdb self._global_updates = None - self.sync() - def _match_wrapper(self, cpv, use_cache=1): """ Make sure the metadata in Package instances gets updated for any diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 7e7d8d081..72c147ee2 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -269,10 +269,14 @@ class depgraph(object): "--nodeps" not in self._frozen_config.myopts and \ "--buildpkgonly" not in self._frozen_config.myopts + fake_vartree = self._frozen_config.trees[myroot]["vartree"] + fake_vartree.sync() + if preload_installed_pkgs: + vardb = fake_vartree.dbapi fakedb = self._dynamic_config._graph_trees[ myroot]["vartree"].dbapi - vardb = self._frozen_config.trees[myroot]["vartree"].dbapi + for pkg in vardb: self._spinner_update() # This triggers metadata updates via FakeVartree. |