Remove the BlockerDB._blocker_cache attribute and just create new
authorZac Medico <zmedico@gentoo.org>
Wed, 25 Jun 2008 07:18:36 +0000 (07:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 25 Jun 2008 07:18:36 +0000 (07:18 -0000)
instances on demand instead of taking space on the heap.

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

pym/_emerge/__init__.py

index 9d0ca28f4eab05343dfcb6237ff307a60ed877de..f267c5422891a379279b64dbb82d75e87229c928 100644 (file)
@@ -1682,15 +1682,14 @@ class BlockerDB(object):
                self._root_config = root_config
                self._vartree = root_config.trees["vartree"]
                self._portdb = root_config.trees["porttree"].dbapi
-               self._blocker_cache = \
-                       BlockerCache(self._vartree.root, self._vartree.dbapi)
+                       
                self._dep_check_trees = { self._vartree.root : {
                        "porttree"    :  self._vartree,
                        "vartree"     :  self._vartree,
                }}
 
        def findInstalledBlockers(self, new_pkg, acquire_lock=0):
-               blocker_cache = self._blocker_cache
+               blocker_cache = BlockerCache(self._vartree.root, self._vartree.dbapi)
                dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
                dep_check_trees = self._dep_check_trees
                settings = self._vartree.settings
@@ -1739,7 +1738,7 @@ class BlockerDB(object):
                blocker_parents = digraph()
                blocker_atoms = []
                for pkg in installed_pkgs:
-                       for blocker_atom in self._blocker_cache[pkg.cpv].atoms:
+                       for blocker_atom in blocker_cache[pkg.cpv].atoms:
                                blocker_atom = blocker_atom[1:]
                                blocker_atoms.append(blocker_atom)
                                blocker_parents.add(blocker_atom, pkg)