diff options
Diffstat (limited to 'pym/portage/repository/config.py')
-rw-r--r-- | pym/portage/repository/config.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 7f0d392a5..0d4412082 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -17,7 +17,7 @@ import codecs class RepoConfig(object): """Stores config of one repository""" __slots__ = ['aliases', 'eclass_overrides', 'location', 'masters', 'main_repo', - 'missing_repo_name', 'name', 'priority', 'sync'] + 'missing_repo_name', 'name', 'priority', 'sync', 'format'] def __init__(self, name, repo_opts): """Build a RepoConfig with options in repo_opts Try to read repo_name in repository location, but if @@ -52,6 +52,11 @@ class RepoConfig(object): sync = sync.strip() self.sync = sync + format = repo_opts.get('format') + if format is not None: + format = format.strip() + self.format = format + self.missing_repo_name = False location = repo_opts.get('location') @@ -236,6 +241,10 @@ class RepoConfigLoader(object): else: return '' + def mainRepo(self): + """Returns the main repo""" + return self.prepos[self.prepos['DEFAULT'].main_repo] + def _check_locations(self): """Check if repositories location are correct and show a warning message if not""" for (name, r) in self.prepos.items(): @@ -248,6 +257,12 @@ class RepoConfigLoader(object): writemsg(_("!!! Invalid Repository Location" " (not a dir): '%s'\n") % r.location, noiselevel=-1) + def repos_with_profiles(self): + for repo_name in self.prepos_order: + repo = self.prepos[repo_name] + if repo.format != "unavailable": + yield repo + def load_repository_config(settings): #~ repoconfigpaths = [os.path.join(settings.global_config_path, "repos.conf")] #~ repoconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"], |