1 |
Author: zmedico |
2 |
Date: 2008-03-28 23:11:29 +0000 (Fri, 28 Mar 2008) |
3 |
New Revision: 9584 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Bug #214691 - Move the "slot collision" display so that it is shown after |
9 |
the merge list where it is most likely to be seen (along with other depgraph |
10 |
problems). |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/_emerge/__init__.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/_emerge/__init__.py 2008-03-28 21:25:26 UTC (rev 9583) |
16 |
+++ main/trunk/pym/_emerge/__init__.py 2008-03-28 23:11:29 UTC (rev 9584) |
17 |
@@ -1526,6 +1526,7 @@ |
18 |
self._pprovided_args = [] |
19 |
self._missing_args = [] |
20 |
self._masked_installed = [] |
21 |
+ self._unsatisfied_deps_for_display = [] |
22 |
self._dep_stack = [] |
23 |
self._unsatisfied_deps = [] |
24 |
self._ignored_deps = [] |
25 |
@@ -1540,6 +1541,9 @@ |
26 |
already been selected) will be required in order to handle all possible |
27 |
cases.""" |
28 |
|
29 |
+ if not self._slot_collision_info: |
30 |
+ return |
31 |
+ |
32 |
msg = [] |
33 |
msg.append("\n!!! Multiple versions within a single " + \ |
34 |
"package slot have been \n") |
35 |
@@ -1673,8 +1677,8 @@ |
36 |
if allow_unsatisfied: |
37 |
self._unsatisfied_deps.append(dep) |
38 |
continue |
39 |
- self._show_unsatisfied_dep(dep.root, dep.atom, |
40 |
- myparent=dep.parent) |
41 |
+ self._unsatisfied_deps_for_display.append( |
42 |
+ ((dep.root, dep.atom), {"myparent":dep.parent})) |
43 |
return 0 |
44 |
# In some cases, dep_check will return deps that shouldn't |
45 |
# be proccessed any further, so they are identified and |
46 |
@@ -2289,12 +2293,14 @@ |
47 |
if not pkg: |
48 |
if not (isinstance(arg, SetArg) and \ |
49 |
arg.name in ("system", "world")): |
50 |
- self._show_unsatisfied_dep(myroot, atom) |
51 |
+ self._unsatisfied_deps_for_display.append( |
52 |
+ ((myroot, atom), {})) |
53 |
return 0, myfavorites |
54 |
self._missing_args.append((arg, atom)) |
55 |
continue |
56 |
if pkg.installed and "selective" not in self.myparams: |
57 |
- self._show_unsatisfied_dep(myroot, atom) |
58 |
+ self._unsatisfied_deps_for_display.append( |
59 |
+ ((myroot, atom), {})) |
60 |
return 0, myfavorites |
61 |
|
62 |
self._dep_stack.append( |
63 |
@@ -3097,8 +3103,8 @@ |
64 |
# unresolvable blocks. |
65 |
for x in self.altlist(): |
66 |
if x[0] == "blocks": |
67 |
+ self._slot_collision_info.clear() |
68 |
return True |
69 |
- self._show_slot_collision_notice() |
70 |
if not self._accept_collisions(): |
71 |
return False |
72 |
return True |
73 |
@@ -4049,6 +4055,20 @@ |
74 |
print bold('*'+revision) |
75 |
sys.stdout.write(text) |
76 |
|
77 |
+ self.display_problems() |
78 |
+ return os.EX_OK |
79 |
+ |
80 |
+ def display_problems(self): |
81 |
+ """ |
82 |
+ Display problems with the dependency graph such as slot collisions. |
83 |
+ This is called internally by display() to show the problems _after_ |
84 |
+ the merge list where it is most likely to be seen, but if display() |
85 |
+ is not going to be called then this method should be called explicitly |
86 |
+ to ensure that the user is notified of problems with the graph. |
87 |
+ """ |
88 |
+ |
89 |
+ self._show_slot_collision_notice() |
90 |
+ |
91 |
# TODO: Add generic support for "set problem" handlers so that |
92 |
# the below warnings aren't special cases for world only. |
93 |
|
94 |
@@ -4124,8 +4144,10 @@ |
95 |
msg.append("The best course of action depends on the reason that an offending\n") |
96 |
msg.append("package.provided entry exists.\n\n") |
97 |
sys.stderr.write("".join(msg)) |
98 |
- return os.EX_OK |
99 |
|
100 |
+ for pargs, kwargs in self._unsatisfied_deps_for_display: |
101 |
+ self._show_unsatisfied_dep(*pargs, **kwargs) |
102 |
+ |
103 |
def calc_changelog(self,ebuildpath,current,next): |
104 |
if ebuildpath == None or not os.path.exists(ebuildpath): |
105 |
return [] |
106 |
@@ -6800,6 +6822,10 @@ |
107 |
merge_count = 0 |
108 |
pretend = "--pretend" in myopts |
109 |
fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts |
110 |
+ ask = "--ask" in myopts |
111 |
+ tree = "--tree" in myopts |
112 |
+ verbose = "--verbose" in myopts |
113 |
+ quiet = "--quiet" in myopts |
114 |
if pretend or fetchonly: |
115 |
# make the mtimedb readonly |
116 |
mtimedb.filename = None |
117 |
@@ -6904,9 +6930,14 @@ |
118 |
portage.writemsg("\n!!! %s\n" % str(e), noiselevel=-1) |
119 |
return 1 |
120 |
if not retval: |
121 |
+ mydepgraph.display_problems() |
122 |
return 1 |
123 |
if "--quiet" not in myopts and "--nodeps" not in myopts: |
124 |
print "\b\b... done!" |
125 |
+ display = pretend or \ |
126 |
+ ((ask or tree or verbose) and not (quiet and not ask)) |
127 |
+ if not display: |
128 |
+ mydepgraph.display_problems() |
129 |
|
130 |
if "--pretend" not in myopts and \ |
131 |
("--ask" in myopts or "--tree" in myopts or \ |
132 |
|
133 |
-- |
134 |
gentoo-commits@l.g.o mailing list |