1 |
Author: grobian |
2 |
Date: 2009-07-31 07:36:27 +0000 (Fri, 31 Jul 2009) |
3 |
New Revision: 13867 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/repoman |
7 |
main/branches/prefix/pym/_emerge/depgraph.py |
8 |
main/branches/prefix/pym/portage/dbapi/porttree.py |
9 |
Log: |
10 |
Merged from trunk -r13849:13854 |
11 |
|
12 |
| 13850 | Bug #270040 - Make repoman parse the categories file from | |
13 |
| zmedico | the overlay. | |
14 |
|
15 |
| 13851 | Fix --onlydeps breakage. Thanks to Arfrever for reporting. | |
16 |
| zmedico | | |
17 |
|
18 |
| 13852 | When backtracking due to an unsatisfied dependency, show a | |
19 |
| zmedico | normal unsatisfied dependency message for the given atom. | |
20 |
| | Thanks to Thomas Sachau <tommy@g.o> for reporting. | |
21 |
|
22 |
| 13853 | Remove redundant loop inside | |
23 |
| zmedico | depgraph._show_missed_update_slot_conflicts(). | |
24 |
|
25 |
| 13854 | Account for $ROOT inside | |
26 |
| zmedico | depgraph._show_missed_update_unsatisfied_dep(). | |
27 |
|
28 |
|
29 |
Modified: main/branches/prefix/bin/repoman |
30 |
=================================================================== |
31 |
--- main/branches/prefix/bin/repoman 2009-07-31 07:34:04 UTC (rev 13866) |
32 |
+++ main/branches/prefix/bin/repoman 2009-07-31 07:36:27 UTC (rev 13867) |
33 |
@@ -513,6 +513,14 @@ |
34 |
logging.info('PORTDIR = "' + portdir + '"') |
35 |
logging.info('PORTDIR_OVERLAY = "%s"' % env['PORTDIR_OVERLAY']) |
36 |
|
37 |
+categories = [] |
38 |
+for path in set([portdir, portdir_overlay]): |
39 |
+ categories.extend(portage.util.grabfile( |
40 |
+ os.path.join(path, 'profiles', 'categories'))) |
41 |
+repoman_settings.categories = tuple(sorted( |
42 |
+ portage.util.stack_lists([categories], incremental=1))) |
43 |
+del categories |
44 |
+ |
45 |
portdb.mysettings = repoman_settings |
46 |
root_config = RootConfig(repoman_settings, trees[root], None) |
47 |
# We really only need to cache the metadata that's necessary for visibility |
48 |
|
49 |
Modified: main/branches/prefix/pym/_emerge/depgraph.py |
50 |
=================================================================== |
51 |
--- main/branches/prefix/pym/_emerge/depgraph.py 2009-07-31 07:34:04 UTC (rev 13866) |
52 |
+++ main/branches/prefix/pym/_emerge/depgraph.py 2009-07-31 07:36:27 UTC (rev 13867) |
53 |
@@ -278,6 +278,8 @@ |
54 |
'--debug' not in self._frozen_config.myopts: |
55 |
return |
56 |
|
57 |
+ # In order to minimize noise, show only the highest |
58 |
+ # missed update from each SLOT. |
59 |
missed_updates = {} |
60 |
for pkg, mask_reasons in \ |
61 |
self._dynamic_config._runtime_pkg_mask.iteritems(): |
62 |
@@ -286,24 +288,62 @@ |
63 |
# want to show available updates. |
64 |
continue |
65 |
if pkg.slot_atom in missed_updates: |
66 |
- other_pkg, parent_atoms = missed_updates[pkg.slot_atom] |
67 |
+ other_pkg, mask_type, parent_atoms = \ |
68 |
+ missed_updates[pkg.slot_atom] |
69 |
if other_pkg > pkg: |
70 |
continue |
71 |
for mask_type, parent_atoms in mask_reasons.iteritems(): |
72 |
if not parent_atoms: |
73 |
continue |
74 |
- missed_updates[pkg.slot_atom] = (pkg, parent_atoms) |
75 |
+ missed_updates[pkg.slot_atom] = (pkg, mask_type, parent_atoms) |
76 |
break |
77 |
|
78 |
if not missed_updates: |
79 |
return |
80 |
|
81 |
+ missed_update_types = {} |
82 |
+ for pkg, mask_type, parent_atoms in missed_updates.itervalues(): |
83 |
+ missed_update_types.setdefault(mask_type, |
84 |
+ []).append((pkg, parent_atoms)) |
85 |
+ |
86 |
+ self._show_missed_update_slot_conflicts( |
87 |
+ missed_update_types.get("slot conflict")) |
88 |
+ |
89 |
+ self._show_missed_update_unsatisfied_dep( |
90 |
+ missed_update_types.get("missing dependency")) |
91 |
+ |
92 |
+ def _show_missed_update_unsatisfied_dep(self, missed_updates): |
93 |
+ |
94 |
+ if not missed_updates: |
95 |
+ return |
96 |
+ |
97 |
+ write = sys.stderr.write |
98 |
+ |
99 |
+ for pkg, parent_atoms in missed_updates: |
100 |
+ |
101 |
+ write("\n!!! The following update has been skipped " + \ |
102 |
+ "due to unsatisfied dependencies:\n\n") |
103 |
+ |
104 |
+ write(str(pkg.slot_atom)) |
105 |
+ write("\n") |
106 |
+ |
107 |
+ for parent, root, atom in parent_atoms: |
108 |
+ self._show_unsatisfied_dep(root, atom, myparent=parent) |
109 |
+ write("\n") |
110 |
+ |
111 |
+ sys.stderr.flush() |
112 |
+ |
113 |
+ def _show_missed_update_slot_conflicts(self, missed_updates): |
114 |
+ |
115 |
+ if not missed_updates: |
116 |
+ return |
117 |
+ |
118 |
msg = [] |
119 |
msg.append("\n!!! One or more updates have been skipped due to " + \ |
120 |
"a dependency conflict:\n\n") |
121 |
|
122 |
indent = " " |
123 |
- for pkg, parent_atoms in missed_updates.itervalues(): |
124 |
+ for pkg, parent_atoms in missed_updates: |
125 |
msg.append(str(pkg.slot_atom)) |
126 |
msg.append("\n\n") |
127 |
|
128 |
@@ -312,19 +352,19 @@ |
129 |
msg.append(str(pkg)) |
130 |
|
131 |
msg.append(" conflicts with\n") |
132 |
- for parent, atom in parent_atoms: |
133 |
- msg.append(2*indent) |
134 |
- if isinstance(parent, |
135 |
- (PackageArg, AtomArg)): |
136 |
- # For PackageArg and AtomArg types, it's |
137 |
- # redundant to display the atom attribute. |
138 |
- msg.append(str(parent)) |
139 |
- else: |
140 |
- # Display the specific atom from SetArg or |
141 |
- # Package types. |
142 |
- msg.append("%s required by %s" % (atom, parent)) |
143 |
- msg.append("\n") |
144 |
+ msg.append(2*indent) |
145 |
+ if isinstance(parent, |
146 |
+ (PackageArg, AtomArg)): |
147 |
+ # For PackageArg and AtomArg types, it's |
148 |
+ # redundant to display the atom attribute. |
149 |
+ msg.append(str(parent)) |
150 |
+ else: |
151 |
+ # Display the specific atom from SetArg or |
152 |
+ # Package types. |
153 |
+ msg.append("%s required by %s" % (atom, parent)) |
154 |
msg.append("\n") |
155 |
+ msg.append("\n") |
156 |
+ |
157 |
sys.stderr.write("".join(msg)) |
158 |
sys.stderr.flush() |
159 |
|
160 |
@@ -680,7 +720,7 @@ |
161 |
if dep_pkg is None: |
162 |
self._dynamic_config._runtime_pkg_mask.setdefault( |
163 |
dep.parent, {})["missing dependency"] = \ |
164 |
- set([(dep.parent, dep.atom)]) |
165 |
+ set([(dep.parent, dep.root, dep.atom)]) |
166 |
self._dynamic_config._need_restart = True |
167 |
|
168 |
return 0 |
169 |
@@ -1934,6 +1974,11 @@ |
170 |
traversed_nodes.add(node) |
171 |
msg.append('(dependency required by "%s" [%s])' % \ |
172 |
(colorize('INFORM', str(node.cpv)), node.type_name)) |
173 |
+ |
174 |
+ if node not in self._dynamic_config.digraph: |
175 |
+ # The parent is not in the graph due to backtracking. |
176 |
+ break |
177 |
+ |
178 |
# When traversing to parents, prefer arguments over packages |
179 |
# since arguments are root nodes. Never traverse the same |
180 |
# package twice, in order to prevent an infinite loop. |
181 |
@@ -2430,7 +2475,7 @@ |
182 |
except KeyError: |
183 |
raise portage.exception.PackageNotFound(cpv) |
184 |
pkg = Package(built=(type_name != "ebuild"), cpv=cpv, |
185 |
- installed=installed, metadata=metadata, |
186 |
+ installed=installed, metadata=metadata, onlydeps=onlydeps, |
187 |
root_config=root_config, type_name=type_name) |
188 |
self._frozen_config._pkg_cache[pkg] = pkg |
189 |
return pkg |
190 |
|
191 |
Modified: main/branches/prefix/pym/portage/dbapi/porttree.py |
192 |
=================================================================== |
193 |
--- main/branches/prefix/pym/portage/dbapi/porttree.py 2009-07-31 07:34:04 UTC (rev 13866) |
194 |
+++ main/branches/prefix/pym/portage/dbapi/porttree.py 2009-07-31 07:36:27 UTC (rev 13867) |
195 |
@@ -124,6 +124,10 @@ |
196 |
"Define self.settings as an alias for self.mysettings, " + \ |
197 |
"for conformity with other dbapi classes.") |
198 |
|
199 |
+ @property |
200 |
+ def _categories(self): |
201 |
+ return self.settings.categories |
202 |
+ |
203 |
def __init__(self, porttree_root, mysettings=None): |
204 |
portdbapi.portdbapi_instances.append(self) |
205 |
|
206 |
@@ -133,7 +137,7 @@ |
207 |
else: |
208 |
from portage import settings |
209 |
self.mysettings = config(clone=settings) |
210 |
- self._categories = self.mysettings.categories |
211 |
+ |
212 |
# This is strictly for use in aux_get() doebuild calls when metadata |
213 |
# is generated by the depend phase. It's safest to use a clone for |
214 |
# this purpose because doebuild makes many changes to the config |