":".join(filter(None, sandbox_write))
self.porttrees = list(self.settings.repositories.repoLocationList())
- self.eclassdb = eclass_cache.cache(self.settings.repositories.mainRepoLocation())
+ 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
#Create eclass dbs
self._repo_info = {}
- eclass_dbs = {self.settings.repositories.mainRepoLocation() : self.eclassdb}
for repo in self.repositories:
if repo.location in self._repo_info:
continue
- eclass_db = None
- for eclass_location in repo.eclass_locations:
- tree_db = eclass_dbs.get(eclass_location)
- if tree_db is None:
- tree_db = eclass_cache.cache(eclass_location)
- eclass_dbs[eclass_location] = tree_db
- if eclass_db is None:
- eclass_db = tree_db.copy()
- else:
- eclass_db.append(tree_db)
-
- self._repo_info[repo.location] = _repo_info(repo.name, repo.location, eclass_db)
+ 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))
from configparser import SafeConfigParser
except ImportError:
from ConfigParser import SafeConfigParser, ParsingError
-from portage import os
+from portage import eclass_cache, os
from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
REPO_NAME_LOC, USER_CONFIG_PATH)
from portage.env.loaders import KeyValuePairFileLoader
__slots__ = ('aliases', 'allow_missing_manifest',
'cache_formats', 'create_manifest', 'disable_manifest',
- 'eclass_overrides', 'eclass_locations', 'format', 'location',
+ 'eclass_db', 'eclass_locations', 'eclass_overrides', 'format', 'location',
'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
'name', 'priority', 'sign_manifest', 'sync', 'thin_manifest',
'update_changelog', 'user_location', 'portage1_profiles',
if eclass_overrides is not None:
eclass_overrides = tuple(eclass_overrides.split())
self.eclass_overrides = eclass_overrides
- #Locations are computed later.
+ # Eclass databases and locations are computed later.
+ self.eclass_db = None
self.eclass_locations = None
# Masters from repos.conf override layout.conf.
level=logging.ERROR, noiselevel=-1)
repo.eclass_locations = tuple(eclass_locations)
+ eclass_dbs = {}
+ for repo_name, repo in prepos.items():
+ if repo_name == "DEFAULT":
+ continue
+
+ eclass_db = None
+ for eclass_location in repo.eclass_locations:
+ tree_db = eclass_dbs.get(eclass_location)
+ if tree_db is None:
+ tree_db = eclass_cache.cache(eclass_location)
+ eclass_dbs[eclass_location] = tree_db
+ if eclass_db is None:
+ eclass_db = tree_db.copy()
+ else:
+ eclass_db.append(tree_db)
+ repo.eclass_db = eclass_db
+
self._prepos_changed = True
self._repo_location_list = []