1 |
Author: zmedico |
2 |
Date: 2008-11-18 21:13:03 +0000 (Tue, 18 Nov 2008) |
3 |
New Revision: 11994 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
When warning about 'missing repo_name', also give the exact path where the |
9 |
entry should exist, and explain that it should be a plain text file containing |
10 |
a unique name of the first line. This should give the users enough information |
11 |
to correct the problem without needing to seek help. |
12 |
|
13 |
|
14 |
Modified: main/trunk/pym/_emerge/__init__.py |
15 |
=================================================================== |
16 |
--- main/trunk/pym/_emerge/__init__.py 2008-11-18 08:17:58 UTC (rev 11993) |
17 |
+++ main/trunk/pym/_emerge/__init__.py 2008-11-18 21:13:03 UTC (rev 11994) |
18 |
@@ -13904,22 +13904,30 @@ |
19 |
|
20 |
if "--quiet" not in myopts: |
21 |
portage.deprecated_profile_check() |
22 |
+ missing_repo_names = set() |
23 |
for root in trees: |
24 |
if "porttree" in trees[root]: |
25 |
db = trees[root]["porttree"].dbapi |
26 |
paths = (db.mysettings["PORTDIR"]+" "+db.mysettings["PORTDIR_OVERLAY"]).split() |
27 |
- paths = [os.path.realpath(p) for p in paths] |
28 |
+ missing_repo_names.update(os.path.realpath(p) for p in paths) |
29 |
repos = db.getRepositories() |
30 |
for r in repos: |
31 |
- p = db.getRepositoryPath(r) |
32 |
- try: |
33 |
- paths.remove(p) |
34 |
- except ValueError: |
35 |
- pass |
36 |
- for p in paths: |
37 |
- writemsg("WARNING: repository at %s is missing a repo_name entry\n" % p) |
38 |
- |
39 |
+ missing_repo_names.discard(db.getRepositoryPath(r)) |
40 |
|
41 |
+ if missing_repo_names: |
42 |
+ msg = [] |
43 |
+ msg.append("WARNING: One or more repositories " + \ |
44 |
+ "have missing repo_name entries:") |
45 |
+ msg.append("") |
46 |
+ for p in missing_repo_names: |
47 |
+ msg.append("\t%s/profiles/repo_name" % (p,)) |
48 |
+ msg.append("") |
49 |
+ msg.extend(textwrap.wrap("NOTE: Each repo_name entry " + \ |
50 |
+ "should be a plain text file containing a unique " + \ |
51 |
+ "name for the repository on the first line.", 70)) |
52 |
+ writemsg_level("".join("%s\n" % l for l in msg), |
53 |
+ level=logging.WARNING, noiselevel=-1) |
54 |
+ |
55 |
eclasses_overridden = {} |
56 |
for mytrees in trees.itervalues(): |
57 |
mydb = mytrees["porttree"].dbapi |