aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2013-07-25 20:25:05 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2013-07-25 20:25:05 +0200
commiteb7bb7d4e08ed32502864a20c678c7fc4e1f1277 (patch)
tree5a1f4fc98f822b35301cc3f0284dce49dfac239f /pym/portage/repository/config.py
parentrepoman: auto disable bad commit opts, bug 478156 (diff)
downloadportage-eb7bb7d4e08ed32502864a20c678c7fc4e1f1277.tar.gz
portage-eb7bb7d4e08ed32502864a20c678c7fc4e1f1277.tar.bz2
portage-eb7bb7d4e08ed32502864a20c678c7fc4e1f1277.zip
Print more consistent error messages for entries in repos.conf.
Diffstat (limited to 'pym/portage/repository/config.py')
-rw-r--r--pym/portage/repository/config.py37
1 files changed, 23 insertions, 14 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 8b9ed2c47..a79de4a5f 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -623,23 +623,32 @@ class RepoConfigLoader(object):
if repo_name != 'DEFAULT':
# Skip this warning for repoman (bug #474578).
if settings.local_config and paths:
- writemsg_level(_("Location undefined for " \
- "repository '%s' referenced in '%s'\n") % \
- (repo.name, (paths if len(paths) > 1 else paths[0])),
- level=logging.ERROR, noiselevel=-1)
- del prepos[repo_name]
- else:
- if repo.name != repo_name and not portage._sync_disabled_warnings:
- writemsg_level("!!! %s\n" % _("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
- (repo_name, repo.name), level=logging.ERROR, noiselevel=-1)
+ writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf is missing location attribute") %
+ repo.name, level=logging.ERROR, noiselevel=-1)
del prepos[repo_name]
continue
+ else:
+ if not portage._sync_disabled_warnings:
+ if repo.location and not isdir_raise_eaccess(repo.location):
+ writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has location attribute set "
+ "to nonexistent directory: '%s'") %
+ (repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
+ del prepos[repo_name]
+ continue
- if repo.location and not exists_raise_eaccess(repo.location) and not portage._sync_disabled_warnings:
- writemsg_level("!!! %s\n" % _("Repository '%s' has location attribute set to nonexistent directory: '%s'") %
- (repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
- del prepos[repo_name]
- continue
+ if repo.missing_repo_name:
+ writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf refers to repository "
+ "without repository name set in '%s'") %
+ (repo_name, os.path.join(repo.location, REPO_NAME_LOC)), level=logging.ERROR, noiselevel=-1)
+ del prepos[repo_name]
+ continue
+
+ if repo.name != repo_name:
+ writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has name different "
+ "from repository name '%s' set inside repository") %
+ (repo_name, repo.name), level=logging.ERROR, noiselevel=-1)
+ del prepos[repo_name]
+ continue
location_map[repo.location] = repo_name
treemap[repo_name] = repo.location