From: Zac Medico Date: Mon, 24 Apr 2006 00:36:19 +0000 (-0000) Subject: Do lazy initialization of portage.db[root][porttree] and db[root][vartree] for quicke... X-Git-Tag: v2.1_pre10~68 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=377def13062f0c4e74db0e17e3b0aeb9ecc89d83;p=portage.git Do lazy initialization of portage.db[root][porttree] and db[root][vartree] for quicker portage import. svn path=/main/trunk/; revision=3206 --- diff --git a/pym/portage.py b/pym/portage.py index d7b854dbd..27891b6e9 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6503,11 +6503,11 @@ def do_vartree(mysettings): global db, root, settings db["/"] = portage_util.LazyItemsDict(db.get("/", None)) db["/"].addLazySingleton("virtuals", settings.getvirtuals, "/") - db["/"]["vartree"] = vartree("/") + db["/"].addLazySingleton("vartree", vartree, "/") if root!="/": db[root] = portage_util.LazyItemsDict(db.get(root, None)) db[root].addLazySingleton("virtuals", settings.getvirtuals, root) - db[root]["vartree"] = vartree(root) + db[root].addLazySingleton("vartree", vartree, root) #We need to create the vartree first, then load our settings, and then set up our other trees usedefaults=settings.use_defs @@ -6835,10 +6835,10 @@ class LazyBintreeItem(object): self._bintree.populate() return self._bintree -db["/"]["porttree"] = portagetree("/") +db["/"].addLazySingleton("porttree", portagetree, "/") db["/"].addLazyItem("bintree", LazyBintreeItem("/")) if root!="/": - db[root]["porttree"] = portagetree(root) + db[root].addLazySingleton("porttree", portagetree, root) db[root].addLazyItem("bintree", LazyBintreeItem(root)) thirdpartymirrors = settings.thirdpartymirrors()