summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/porttree.py
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2011-12-09 06:51:26 +0100
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2011-12-09 06:51:26 +0100
commit611268630be4349727b3bf39a1249953f04e3b7f (patch)
tree194a7c272d0fd95ffdbe986d48578e8cfcb6552c /pym/portage/dbapi/porttree.py
parent12f18ab6ae8d732a39924536f585dc5ab7af8bbd (diff)
downloadportage-611268630be4349727b3bf39a1249953f04e3b7f.tar.gz
portage-611268630be4349727b3bf39a1249953f04e3b7f.tar.bz2
portage-611268630be4349727b3bf39a1249953f04e3b7f.zip
Delete portage.dbapi.porttree._repo_info class and _repo_info attribute of
portage.dbapi.porttree.portdbapi objects. Migrate consumers to repositories attribute of portage.dbapi.porttree.portdbapi objects.
Diffstat (limited to 'pym/portage/dbapi/porttree.py')
-rw-r--r--pym/portage/dbapi/porttree.py24
1 files changed, 3 insertions, 21 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 94961dda1..e483edb93 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -46,15 +46,6 @@ if sys.hexversion >= 0x3000000:
basestring = str
long = int
-class _repo_info(object):
- __slots__ = ('name', 'path', 'eclass_db', 'portdir', 'portdir_overlay')
- def __init__(self, name, path, eclass_db):
- self.name = name
- self.path = path
- self.eclass_db = eclass_db
- self.portdir = eclass_db.porttrees[0]
- self.portdir_overlay = ' '.join(eclass_db.porttrees[1:])
-
class portdbapi(dbapi):
"""this tree will scan a portage directory located at root (passed to init)"""
portdbapi_instances = []
@@ -124,14 +115,6 @@ class portdbapi(dbapi):
self.xcache = {}
self.frozen = 0
- #Create eclass dbs
- self._repo_info = {}
- for repo in self.repositories:
- if repo.location in self._repo_info:
- continue
-
- self._repo_info[repo.location] = _repo_info(repo.name, repo.location, repo.eclass_db)
-
#Keep a list of repo names, sorted by priority (highest priority first).
self._ordered_repo_name_list = tuple(reversed(self.repositories.prepos_order))
@@ -211,7 +194,7 @@ class portdbapi(dbapi):
self._known_keys, readonly=True)
if cache is not None:
try:
- cache.ec = self._repo_info[tree].eclass_db
+ cache.ec = self.repositories.get_repo_for_location(tree).eclass_db
except AttributeError:
pass
return cache
@@ -362,8 +345,7 @@ class portdbapi(dbapi):
metadata = dict(i)
if metadata.get("INHERITED", False):
- metadata["_eclasses_"] = self._repo_info[repo_path
- ].eclass_db.get_eclass_data(metadata["INHERITED"].split())
+ metadata["_eclasses_"] = self.repositories.get_repo_for_location(repo_path).eclass_db.get_eclass_data(metadata["INHERITED"].split())
else:
metadata["_eclasses_"] = {}
@@ -423,7 +405,7 @@ class portdbapi(dbapi):
if ro_auxdb is not None:
auxdbs.append(ro_auxdb)
auxdbs.append(self.auxdb[repo_path])
- eclass_db = self._repo_info[repo_path].eclass_db
+ eclass_db = self.repositories.get_repo_for_location(repo_path).eclass_db
for auxdb in auxdbs:
try: