From: Zac Medico Date: Sat, 16 Oct 2010 02:49:56 +0000 (-0700) Subject: emerge --depclean: Add more --debug output. X-Git-Tag: v2.2_rc97 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ff51472bc6f3de5ec0a266370a6affdab1c894c0;p=portage.git emerge --depclean: Add more --debug output. --- diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index d9dbfb473..5ac676d91 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -618,6 +618,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, myopts, action, args_set, spinner): allow_missing_deps = bool(args_set) + debug = '--debug' in myopts xterm_titles = "notitles" not in settings.features myroot = settings["ROOT"] root_config = trees[myroot]["root_config"] @@ -1102,6 +1103,7 @@ def calc_depclean(settings, trees, ldpath_mtimes, clean_set = set(cleanlist) if clean_set: + writemsg_level(">>> Calculating removal order...\n") # Use a topological sort to create an unmerge order such that # each package is unmerged before it's dependencies. This is # necessary to avoid breaking things that may need to run @@ -1130,6 +1132,15 @@ def calc_depclean(settings, trees, ldpath_mtimes, if not depstr: continue priority = priority_map[dep_type] + + if debug: + writemsg_level(_unicode_decode("\nParent: %s\n") \ + % (node,), noiselevel=-1, level=logging.DEBUG) + writemsg_level(_unicode_decode( "Depstring: %s\n") \ + % (depstr,), noiselevel=-1, level=logging.DEBUG) + writemsg_level(_unicode_decode( "Priority: %s\n") \ + % (priority,), noiselevel=-1, level=logging.DEBUG) + try: atoms = resolver._select_atoms(myroot, depstr, myuse=node.use.enabled, parent=node, @@ -1139,6 +1150,11 @@ def calc_depclean(settings, trees, ldpath_mtimes, # be uninstalled anyway. continue + if debug: + writemsg_level("Candidates: [%s]\n" % \ + ', '.join(_unicode_decode("'%s'") % (x,) for x in atoms), + noiselevel=-1, level=logging.DEBUG) + for atom in atoms: if not isinstance(atom, portage.dep.Atom): # Ignore invalid atoms returned from dep_check(). @@ -1152,6 +1168,12 @@ def calc_depclean(settings, trees, ldpath_mtimes, if child_node in clean_set: graph.add(child_node, node, priority=priority) + if debug: + writemsg_level("\nunmerge digraph:\n\n", + noiselevel=-1, level=logging.DEBUG) + graph.debug_print() + writemsg_level("\n", noiselevel=-1, level=logging.DEBUG) + ordered = True if len(graph.order) == len(graph.root_nodes()): # If there are no dependencies between packages diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 087e456fd..fa8ddefc2 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1480,6 +1480,7 @@ def emerge_main(): if settings.get("PORTAGE_DEBUG", "") == "1": spinner.update = spinner.update_quiet portage.debug=1 + portage.util.noiselimit = 0 if "python-trace" in settings.features: import portage.debug portage.debug.set_trace(True)