summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-02 23:56:18 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-02 23:56:18 +0000
commitbc5b2d6faf8a6d1bde0cea68ef1a8b61ebb253c1 (patch)
treec64f380ca68af4c8664446f50b4e77ae6ba00326
parent8a5fa6abcf92d0da7cbd333bf4de5f4de6faf38b (diff)
downloadportage-bc5b2d6faf8a6d1bde0cea68ef1a8b61ebb253c1.tar.gz
portage-bc5b2d6faf8a6d1bde0cea68ef1a8b61ebb253c1.tar.bz2
portage-bc5b2d6faf8a6d1bde0cea68ef1a8b61ebb253c1.zip
Move RootConfig.visible_pkgs to dynamic_config._visible_pkgs, so RootConfig
can be considered entirely "frozen". svn path=/main/trunk/; revision=13758
-rw-r--r--pym/_emerge/RootConfig.py2
-rw-r--r--pym/_emerge/depgraph.py9
2 files changed, 7 insertions, 4 deletions
diff --git a/pym/_emerge/RootConfig.py b/pym/_emerge/RootConfig.py
index 8d1a744c6..48af99120 100644
--- a/pym/_emerge/RootConfig.py
+++ b/pym/_emerge/RootConfig.py
@@ -28,5 +28,3 @@ class RootConfig(object):
self.sets = {}
else:
self.sets = self.setconfig.getSets()
- self.visible_pkgs = PackageVirtualDbapi(self.settings)
-
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 54e2e126b..9b10b3fcf 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -123,6 +123,7 @@ class _frozen_depgraph_config(object):
pass
filtered_tree.dbapi = _dep_check_composite_db(depgraph, myroot)
dynamic_config._filtered_trees[myroot]["porttree"] = filtered_tree
+ dynamic_config._visible_pkgs[myroot] = PackageVirtualDbapi(vardb.settings)
# Passing in graph_tree as the vartree here could lead to better
# atom selections in some cases by causing atoms for packages that
@@ -177,6 +178,9 @@ class _dynamic_depgraph_config(object):
# Contains a filtered view of preferred packages that are selected
# from available repositories.
self._filtered_trees = {}
+ # Caches visible packages returned from _select_package, for use in
+ # depgraph._iter_atoms_for_pkg() SLOT logic.
+ self._visible_pkgs = {}
# All Package instances
self._pkg_cache = {}
#contains the args created by select_files
@@ -1062,7 +1066,8 @@ class depgraph(object):
if atom_cp != pkg.cp and \
self._have_new_virt(pkg.root, atom_cp):
continue
- visible_pkgs = root_config.visible_pkgs.match_pkgs(atom)
+ visible_pkgs = \
+ self._dynamic_config._visible_pkgs[pkg.root].match_pkgs(atom)
visible_pkgs.reverse() # descending order
higher_slot = None
for visible_pkg in visible_pkgs:
@@ -1889,7 +1894,7 @@ class depgraph(object):
settings = pkg.root_config.settings
if visible(settings, pkg) and not (pkg.installed and \
settings._getMissingKeywords(pkg.cpv, pkg.metadata)):
- pkg.root_config.visible_pkgs.cpv_inject(pkg)
+ self._dynamic_config._visible_pkgs[pkg.root].cpv_inject(pkg)
return ret
def _select_pkg_highest_available_imp(self, root, atom, onlydeps=False):