RepoConfigLoader: delete repo if location missing
authorZac Medico <zmedico@gentoo.org>
Tue, 18 Jun 2013 16:13:43 +0000 (09:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 18 Jun 2013 16:13:43 +0000 (09:13 -0700)
pym/portage/repository/config.py

index da8c36561e572a6a696e39e2d1646eb11d115b4d..a63bc9ca1681950e916a3c42cdf6d7a976029d42 100644 (file)
@@ -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