aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-07-24 13:37:59 -0700
committerZac Medico <zmedico@gentoo.org>2013-07-24 13:37:59 -0700
commit0bc0417ef698790dfed8fe7c256b19ad946392c1 (patch)
tree71ff4a8a88460590cbdd8e80d15dd557f88c7dc5 /pym/portage/repository/config.py
parentemirrordist: Require --repo option, deprecate --portdir and --portdir-overlay (diff)
downloadportage-0bc0417ef698790dfed8fe7c256b19ad946392c1.tar.gz
portage-0bc0417ef698790dfed8fe7c256b19ad946392c1.tar.bz2
portage-0bc0417ef698790dfed8fe7c256b19ad946392c1.zip
Avoid redundant parse_layout_conf() calls.
Diffstat (limited to 'pym/portage/repository/config.py')
-rw-r--r--pym/portage/repository/config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index de471e92c..8b9ed2c47 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -84,7 +84,7 @@ class RepoConfig(object):
'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
'profile_formats', 'sign_commit', 'sign_manifest', 'sync_cvs_repo',
'sync_type', 'sync_uri', 'thin_manifest', 'update_changelog',
- 'user_location', '_eapis_banned', '_eapis_deprecated')
+ 'user_location', '_eapis_banned', '_eapis_deprecated', '_masters_orig')
def __init__(self, name, repo_opts, local_config=True):
"""Build a RepoConfig with options in repo_opts
@@ -201,10 +201,12 @@ class RepoConfig(object):
self.portage1_profiles = True
self.portage1_profiles_compat = False
self.find_invalid_path_char = _find_invalid_path_char
+ self._masters_orig = None
# Parse layout.conf.
if self.location:
layout_data = parse_layout_conf(self.location, self.name)[0]
+ self._masters_orig = layout_data['masters']
# layout.conf masters may be overridden here if we have a masters
# setting from the user's repos.conf
@@ -776,7 +778,7 @@ class RepoConfigLoader(object):
if repo_name == "DEFAULT":
continue
- if parse_layout_conf(repo.location, repo_name)[0]["masters"] is None and self.mainRepo() and \
+ if repo._masters_orig is None and self.mainRepo() and \
repo_name != self.mainRepo().name and not portage._sync_disabled_warnings:
writemsg_level("!!! %s\n" % _("Repository '%s' is missing masters attribute in '%s'") %
(repo_name, os.path.join(repo.location, "metadata", "layout.conf")) +