summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-28 23:27:52 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-28 23:27:52 +0000
commitf66e8b14afa0ed47733093afae8d187af8e7c19b (patch)
tree13dce7a0c60c846529110c6d9deeff84a168d103
parent65c0217a113fa7a088252cab18d7d5a97b5e05fd (diff)
downloadportage-f66e8b14afa0ed47733093afae8d187af8e7c19b.tar.gz
portage-f66e8b14afa0ed47733093afae8d187af8e7c19b.tar.bz2
portage-f66e8b14afa0ed47733093afae8d187af8e7c19b.zip
When backtracking due to an unsatisfied dependency, show a normal unsatisfied
dependency message for the given atom. Thanks to Thomas Sachau <tommy@gentoo.org> for reporting. svn path=/main/trunk/; revision=13852
-rw-r--r--pym/_emerge/depgraph.py52
1 files changed, 49 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index dc74b3669..527b2f9fa 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -276,6 +276,8 @@ class depgraph(object):
'--debug' not in self._frozen_config.myopts:
return
+ # In order to minimize noise, show only the highest
+ # missed update from each SLOT.
missed_updates = {}
for pkg, mask_reasons in \
self._dynamic_config._runtime_pkg_mask.iteritems():
@@ -284,24 +286,63 @@ class depgraph(object):
# want to show available updates.
continue
if pkg.slot_atom in missed_updates:
- other_pkg, parent_atoms = missed_updates[pkg.slot_atom]
+ other_pkg, mask_type, parent_atoms = \
+ missed_updates[pkg.slot_atom]
if other_pkg > pkg:
continue
for mask_type, parent_atoms in mask_reasons.iteritems():
if not parent_atoms:
continue
- missed_updates[pkg.slot_atom] = (pkg, parent_atoms)
+ missed_updates[pkg.slot_atom] = (pkg, mask_type, parent_atoms)
break
if not missed_updates:
return
+ missed_update_types = {}
+ for pkg, mask_type, parent_atoms in missed_updates.itervalues():
+ missed_update_types.setdefault(mask_type,
+ []).append((pkg, parent_atoms))
+
+ self._show_missed_update_slot_conflicts(
+ missed_update_types.get("slot conflict"))
+
+ self._show_missed_update_unsatisfied_dep(
+ missed_update_types.get("missing dependency"))
+
+ def _show_missed_update_unsatisfied_dep(self, missed_updates):
+
+ if not missed_updates:
+ return
+
+ write = sys.stderr.write
+
+ for pkg, parent_atoms in missed_updates:
+
+ write("\n!!! The following update has been skipped " + \
+ "due to unsatisfied dependencies:\n\n")
+
+ write(str(pkg.slot_atom))
+ write("\n")
+
+ for parent, atom in parent_atoms:
+ # TODO: Account for which $ROOT the atom applies to.
+ self._show_unsatisfied_dep(parent.root, atom, myparent=parent)
+ write("\n")
+
+ sys.stderr.flush()
+
+ def _show_missed_update_slot_conflicts(self, missed_updates):
+
+ if not missed_updates:
+ return
+
msg = []
msg.append("\n!!! One or more updates have been skipped due to " + \
"a dependency conflict:\n\n")
indent = " "
- for pkg, parent_atoms in missed_updates.itervalues():
+ for pkg, parent_atoms in missed_updates:
msg.append(str(pkg.slot_atom))
msg.append("\n\n")
@@ -1932,6 +1973,11 @@ class depgraph(object):
traversed_nodes.add(node)
msg.append('(dependency required by "%s" [%s])' % \
(colorize('INFORM', str(node.cpv)), node.type_name))
+
+ if node not in self._dynamic_config.digraph:
+ # The parent is not in the graph due to backtracking.
+ break
+
# When traversing to parents, prefer arguments over packages
# since arguments are root nodes. Never traverse the same
# package twice, in order to prevent an infinite loop.