Pass config and portdbapi instances into the portagetree constructor.
authorZac Medico <zmedico@gentoo.org>
Fri, 30 Jun 2006 08:27:59 +0000 (08:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 30 Jun 2006 08:27:59 +0000 (08:27 -0000)
svn path=/main/trunk/; revision=3710

pym/portage.py

index a72d2a1f4cb4e1816c233b7df3de176c6507a6a4..66e003a31e410c370c4a6696a3f2cecec6670163 100644 (file)
@@ -7114,7 +7114,7 @@ class MtimeDB(dict):
        def commit(self):
                commit_mtimedb(mydict=self, filename=self.filename)
 
-def do_vartree(mysettings, trees=None):
+def do_vartree(mysettings, portdb=None, trees=None):
        if trees is None:
                global db
                trees = db
@@ -7128,7 +7128,8 @@ def do_vartree(mysettings, trees=None):
                trees[myroot].addLazySingleton(
                        "vartree", vartree, myroot, categories=mysettings.categories,
                                settings=mysettings)
-               trees[myroot].addLazySingleton("porttree", portagetree, myroot)
+               trees[myroot].addLazySingleton("porttree",
+                       portagetree, myroot, settings=mysettings, portdb=portdb)
                trees[myroot].addLazyItem("bintree",
                        LazyBintreeItem(myroot, mysettings))
 
@@ -7166,8 +7167,8 @@ def init_legacy_globals():
 
        root = settings["ROOT"]
        db={}
-       do_vartree(settings, trees=db)
        portdb = portdbapi(settings["PORTDIR"], mysettings=config(clone=settings))
+       do_vartree(settings, portdb=portdb, trees=db)
 
        mtimedbfile = os.path.join("/", CACHE_PATH.lstrip(os.path.sep), "mtimedb")
        mtimedb = MtimeDB(mtimedbfile)