From 86d69ef86ab2a9addec6a290a1c3958bc2ba55de Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 18 Jun 2013 09:13:43 -0700 Subject: [PATCH] RepoConfigLoader: delete repo if location missing --- pym/portage/repository/config.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index da8c36561..a63bc9ca1 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -508,8 +508,16 @@ class RepoConfigLoader(object): # Do this before expanding aliases, so that location_map and # treemap consistently map unaliased names whenever available. - for repo_name, repo in prepos.items(): - if repo.location is not None: + for repo_name, repo in list(prepos.items()): + if repo.location is None: + if repo_name != 'DEFAULT': + if paths: + writemsg_level(_("Location undefined for " \ + "repository '%s' referenced in '%s'\n") % \ + (repo.name, paths[0]), + level=logging.ERROR, noiselevel=-1) + del prepos[repo_name] + else: location_map[repo.location] = repo_name treemap[repo_name] = repo.location -- 2.26.2