public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r13852 - main/trunk/pym/_emerge
@ 2009-07-28 23:27 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-07-28 23:27 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-07-28 23:27:52 +0000 (Tue, 28 Jul 2009)
New Revision: 13852

Modified:
   main/trunk/pym/_emerge/depgraph.py
Log:
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.


Modified: main/trunk/pym/_emerge/depgraph.py
===================================================================
--- main/trunk/pym/_emerge/depgraph.py	2009-07-25 09:33:18 UTC (rev 13851)
+++ main/trunk/pym/_emerge/depgraph.py	2009-07-28 23:27:52 UTC (rev 13852)
@@ -276,6 +276,8 @@
 			'--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 @@
 				# 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 @@
 			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.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-28 23:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-28 23:27 [gentoo-commits] portage r13852 - main/trunk/pym/_emerge Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox