summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/porttree.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-09 23:04:24 -0800
committerZac Medico <zmedico@gentoo.org>2011-12-09 23:04:24 -0800
commit716ad204d2107092704e4188f3a73736ec836d44 (patch)
tree1737cc6bdccf8527bdf0e9bdc6d42aa40fb6232b /pym/portage/dbapi/porttree.py
parente295b46dfaf9ecf1ba3bcfa8038132053fd1cbd0 (diff)
downloadportage-716ad204d2107092704e4188f3a73736ec836d44.tar.gz
portage-716ad204d2107092704e4188f3a73736ec836d44.tar.bz2
portage-716ad204d2107092704e4188f3a73736ec836d44.zip
Make portdbapi.eclassdb a property.
Diffstat (limited to 'pym/portage/dbapi/porttree.py')
-rw-r--r--pym/portage/dbapi/porttree.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index e483edb93..233a2c1d1 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -59,6 +59,13 @@ class portdbapi(dbapi):
def porttree_root(self):
return self.settings.repositories.mainRepoLocation()
+ @property
+ def eclassdb(self):
+ main_repo = self.repositories.mainRepo()
+ if main_repo is None:
+ return None
+ return main_repo.eclass_db
+
def __init__(self, _unused_param=None, mysettings=None):
"""
@param _unused_param: deprecated, use mysettings['PORTDIR'] instead
@@ -102,7 +109,6 @@ class portdbapi(dbapi):
":".join(filter(None, sandbox_write))
self.porttrees = list(self.settings.repositories.repoLocationList())
- self.eclassdb = self.repositories.mainRepo().eclass_db
# This is used as sanity check for aux_get(). If there is no
# root eclass dir, we assume that PORTDIR is invalid or