From b9e5ca3fa7a4321885a9e750b8af696c248bf03c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 18 Nov 2008 21:13:03 +0000 Subject: [PATCH] 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 --- pym/_emerge/__init__.py | 26 +++++++++++++++++--------- 1 file 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(): -- 2.26.2