summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-18 21:13:03 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-18 21:13:03 +0000
commitb9e5ca3fa7a4321885a9e750b8af696c248bf03c (patch)
tree99bbeec9eb8c6642223aeef67b4c8b437e119eef
parent8190a8913e754bfbf3a1ec8af037d5e177285a73 (diff)
downloadportage-b9e5ca3fa7a4321885a9e750b8af696c248bf03c.tar.gz
portage-b9e5ca3fa7a4321885a9e750b8af696c248bf03c.tar.bz2
portage-b9e5ca3fa7a4321885a9e750b8af696c248bf03c.zip
When warning about 'missing repo_name', also give the exact path where the
entry should exist, and explain that it should be a plain text file containing a unique name of the first line. This should give the users enough information to correct the problem without needing to seek help. svn path=/main/trunk/; revision=11994
-rw-r--r--pym/_emerge/__init__.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 415c9595a..b89398200 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -13904,21 +13904,29 @@ def emerge_main():
if "--quiet" not in myopts:
portage.deprecated_profile_check()
+ missing_repo_names = set()
for root in trees:
if "porttree" in trees[root]:
db = trees[root]["porttree"].dbapi
paths = (db.mysettings["PORTDIR"]+" "+db.mysettings["PORTDIR_OVERLAY"]).split()
- paths = [os.path.realpath(p) for p in paths]
+ missing_repo_names.update(os.path.realpath(p) for p in paths)
repos = db.getRepositories()
for r in repos:
- p = db.getRepositoryPath(r)
- try:
- paths.remove(p)
- except ValueError:
- pass
- for p in paths:
- writemsg("WARNING: repository at %s is missing a repo_name entry\n" % p)
-
+ missing_repo_names.discard(db.getRepositoryPath(r))
+
+ if missing_repo_names:
+ msg = []
+ msg.append("WARNING: One or more repositories " + \
+ "have missing repo_name entries:")
+ msg.append("")
+ for p in missing_repo_names:
+ msg.append("\t%s/profiles/repo_name" % (p,))
+ msg.append("")
+ msg.extend(textwrap.wrap("NOTE: Each repo_name entry " + \
+ "should be a plain text file containing a unique " + \
+ "name for the repository on the first line.", 70))
+ writemsg_level("".join("%s\n" % l for l in msg),
+ level=logging.WARNING, noiselevel=-1)
eclasses_overridden = {}
for mytrees in trees.itervalues():