Move RootConfig.visible_pkgs to dynamic_config._visible_pkgs, so RootConfig
authorZac Medico <zmedico@gentoo.org>
Thu, 2 Jul 2009 23:56:18 +0000 (23:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 2 Jul 2009 23:56:18 +0000 (23:56 -0000)
can be considered entirely "frozen".

svn path=/main/trunk/; revision=13758

pym/_emerge/RootConfig.py
pym/_emerge/depgraph.py

index 8d1a744c6d11b7f17170f0f1473eda957dcb6692..48af991204715524199a59132ff4dfb50371595c 100644 (file)
@@ -28,5 +28,3 @@ class RootConfig(object):
                        self.sets = {}
                else:
                        self.sets = self.setconfig.getSets()
-               self.visible_pkgs = PackageVirtualDbapi(self.settings)
-
index 54e2e126b28762033c0281162447309476066479..9b10b3fcf16f6ba6e28dfbf425fa41074485d186 100644 (file)
@@ -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):