1 |
Author: zmedico |
2 |
Date: 2008-05-03 05:53:06 +0000 (Sat, 03 May 2008) |
3 |
New Revision: 10130 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Similar to the circular dependency display, handle the unsatisfied blocker |
9 |
display inside _serialize_tasks() since that's a convenient place to bail |
10 |
out. |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/_emerge/__init__.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/_emerge/__init__.py 2008-05-03 04:19:04 UTC (rev 10129) |
16 |
+++ main/trunk/pym/_emerge/__init__.py 2008-05-03 05:53:06 UTC (rev 10130) |
17 |
@@ -3348,7 +3348,7 @@ |
18 |
|
19 |
return True |
20 |
|
21 |
- def _accept_collisions(self): |
22 |
+ def _accept_blocker_conflicts(self): |
23 |
acceptable = False |
24 |
for x in ("--buildpkgonly", "--fetchonly", |
25 |
"--fetch-all-uri", "--nodeps", "--pretend"): |
26 |
@@ -3835,6 +3835,26 @@ |
27 |
self.myparams.add("complete") |
28 |
raise self._serialize_tasks_retry("") |
29 |
|
30 |
+ if unsolvable_blockers and \ |
31 |
+ not self._accept_blocker_conflicts(): |
32 |
+ quiet = "--quiet" in self.myopts |
33 |
+ display_list = retlist[:] |
34 |
+ if tree_mode: |
35 |
+ display_list.reverse() |
36 |
+ portage.writemsg("\n", noiselevel=-1) |
37 |
+ self.display(display_list) |
38 |
+ msg = "Error: The above package list contains " + \ |
39 |
+ "packages which cannot be installed " + \ |
40 |
+ "at the same time on the same system." |
41 |
+ prefix = bad(" * ") |
42 |
+ from textwrap import wrap |
43 |
+ portage.writemsg("\n", noiselevel=-1) |
44 |
+ for line in wrap(msg, 70): |
45 |
+ portage.writemsg(prefix + line + "\n", noiselevel=-1) |
46 |
+ if not quiet: |
47 |
+ show_blocker_docs_link() |
48 |
+ raise self._unknown_internal_error() |
49 |
+ |
50 |
return retlist |
51 |
|
52 |
def display(self, mylist, favorites=[], verbosity=None): |
53 |
@@ -7689,26 +7709,10 @@ |
54 |
if show_spinner: |
55 |
print "\b\b... done!" |
56 |
|
57 |
- unsatisfied_block = False |
58 |
- if success: |
59 |
- mymergelist = mydepgraph.altlist() |
60 |
- if mymergelist and \ |
61 |
- (isinstance(mymergelist[-1], Blocker) and \ |
62 |
- not mymergelist[-1].satisfied): |
63 |
- if not fetchonly and not pretend: |
64 |
- unsatisfied_block = True |
65 |
- mydepgraph.display( |
66 |
- mydepgraph.altlist(reversed=tree), |
67 |
- favorites=favorites) |
68 |
- print "\n!!! Error: The above package list contains packages which cannot be installed" |
69 |
- print "!!! at the same time on the same system." |
70 |
- if not quiet: |
71 |
- show_blocker_docs_link() |
72 |
- |
73 |
if not success: |
74 |
mydepgraph.display_problems() |
75 |
|
76 |
- if unsatisfied_block or not success: |
77 |
+ if not success: |
78 |
# delete the current list and also the backup |
79 |
# since it's probably stale too. |
80 |
for k in ("resume", "resume_backup"): |
81 |
@@ -7765,17 +7769,9 @@ |
82 |
return retval |
83 |
mergecount=0 |
84 |
for x in mydepgraph.altlist(): |
85 |
- if isinstance(x, Blocker) and x.satisfied: |
86 |
- continue |
87 |
- if x[0] != "blocks" and x[3] != "nomerge": |
88 |
- mergecount+=1 |
89 |
- #check for blocking dependencies |
90 |
- if x[0]=="blocks" and "--fetchonly" not in myopts and "--fetch-all-uri" not in myopts: |
91 |
- print "\n!!! Error: The above package list contains packages which cannot be installed" |
92 |
- print "!!! at the same time on the same system." |
93 |
- if "--quiet" not in myopts: |
94 |
- show_blocker_docs_link() |
95 |
- return 1 |
96 |
+ if isinstance(x, Package) and x.operation == "merge": |
97 |
+ mergecount += 1 |
98 |
+ |
99 |
if mergecount==0: |
100 |
if "--noreplace" in myopts and favorites: |
101 |
print |
102 |
@@ -7879,30 +7875,6 @@ |
103 |
tree="porttree") |
104 |
|
105 |
pkglist = mydepgraph.altlist() |
106 |
- |
107 |
- if fetchonly or "--buildpkgonly" in myopts: |
108 |
- pkglist = [pkg for pkg in pkglist if pkg[0] != "blocks"] |
109 |
- else: |
110 |
- for x in pkglist: |
111 |
- if isinstance(x, Blocker) and x.satisfied: |
112 |
- continue |
113 |
- if x[0] != "blocks": |
114 |
- continue |
115 |
- retval = mydepgraph.display(mydepgraph.altlist( |
116 |
- reversed=("--tree" in myopts)), |
117 |
- favorites=favorites) |
118 |
- msg = "Error: The above package list contains " + \ |
119 |
- "packages which cannot be installed " + \ |
120 |
- "at the same time on the same system." |
121 |
- prefix = bad(" * ") |
122 |
- from textwrap import wrap |
123 |
- print |
124 |
- for line in wrap(msg, 70): |
125 |
- print prefix + line |
126 |
- if "--quiet" not in myopts: |
127 |
- show_blocker_docs_link() |
128 |
- return 1 |
129 |
- |
130 |
mydepgraph.saveNomergeFavorites() |
131 |
del mydepgraph |
132 |
mergetask = MergeTask(settings, trees, myopts) |
133 |
|
134 |
-- |
135 |
gentoo-commits@l.g.o mailing list |