From 2d08e6c4520556e5acc0055cdb3d68028eed3243 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 10 Feb 2012 19:18:57 -0800 Subject: [PATCH] display_autounmask: highlight config changes As suggested here: http://archives.gentoo.org/gentoo-dev/msg_06a47ad55977f4d16bfe18769c6c38b8.xml --- pym/_emerge/depgraph.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 6d0ba1ca2..cdc50983b 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -6054,6 +6054,14 @@ class depgraph(object): write_to_file = not problems + def format_msg(lines): + lines = lines[:] + for i, line in enumerate(lines): + if line.startswith("#"): + continue + lines[i] = colorize("INFORM", line.rstrip()) + "\n" + return "".join(lines) + for root in roots: settings = self._frozen_config.roots[root].settings abs_user_config = os.path.join( @@ -6065,22 +6073,22 @@ class depgraph(object): if root in unstable_keyword_msg: writemsg_stdout("\nThe following " + colorize("BAD", "keyword changes") + \ " are necessary to proceed:\n", noiselevel=-1) - writemsg_stdout("".join(unstable_keyword_msg[root]), noiselevel=-1) + writemsg_stdout(format_msg(unstable_keyword_msg[root]), noiselevel=-1) if root in p_mask_change_msg: writemsg_stdout("\nThe following " + colorize("BAD", "mask changes") + \ " are necessary to proceed:\n", noiselevel=-1) - writemsg_stdout("".join(p_mask_change_msg[root]), noiselevel=-1) + writemsg_stdout(format_msg(p_mask_change_msg[root]), noiselevel=-1) if root in use_changes_msg: writemsg_stdout("\nThe following " + colorize("BAD", "USE changes") + \ " are necessary to proceed:\n", noiselevel=-1) - writemsg_stdout("".join(use_changes_msg[root]), noiselevel=-1) + writemsg_stdout(format_msg(use_changes_msg[root]), noiselevel=-1) if root in license_msg: writemsg_stdout("\nThe following " + colorize("BAD", "license changes") + \ " are necessary to proceed:\n", noiselevel=-1) - writemsg_stdout("".join(license_msg[root]), noiselevel=-1) + writemsg_stdout(format_msg(license_msg[root]), noiselevel=-1) protect_obj = {} if write_to_file: -- 2.26.2