summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-24 00:36:19 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-24 00:36:19 +0000
commit377def13062f0c4e74db0e17e3b0aeb9ecc89d83 (patch)
tree0a655a157b2e77634728ae8e006e9c86a42eb248
parent12bbf9413b34cf8af252695baac2c3948a9b78aa (diff)
downloadportage-377def13062f0c4e74db0e17e3b0aeb9ecc89d83.tar.gz
portage-377def13062f0c4e74db0e17e3b0aeb9ecc89d83.tar.bz2
portage-377def13062f0c4e74db0e17e3b0aeb9ecc89d83.zip
Do lazy initialization of portage.db[root][porttree] and db[root][vartree] for quicker portage import.
svn path=/main/trunk/; revision=3206
-rw-r--r--pym/portage.py8
1 files changed, 4 insertions, 4 deletions
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()