From: Zac Medico Date: Wed, 8 Jun 2011 20:24:26 +0000 (-0700) Subject: unmerge: show virtual in system unmerge warning X-Git-Tag: v2.2.0_alpha39~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ac01d2898ece4589cdaa971382cc1dc17261ed58;p=portage.git unmerge: show virtual in system unmerge warning This is intended to clarify the messages shown in bug #370295, so that it's obvious when a package is a member of the system set due to it being a virtual provider. --- diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index 38f3515d0..3db3a8be9 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -61,10 +61,13 @@ def _unmerge_display(root_config, myopts, unmerge_action, vdb_lock = True realsyslist = [] + sys_virt_map = {} for x in sets["system"].getAtoms(): for atom in expand_new_virt(vartree.dbapi, x): if not atom.blocker: realsyslist.append(atom) + if atom.cp != x.cp: + sys_virt_map[atom.cp] = x.cp syslist = [] for x in realsyslist: @@ -442,8 +445,13 @@ def _unmerge_display(root_config, myopts, unmerge_action, #avoid cluttering the preview printout with stuff that isn't getting unmerged continue if not (pkgmap[x]["protected"] or pkgmap[x]["omitted"]) and cp in syslist: + virt_cp = sys_virt_map.get(cp) + if virt_cp is None: + cp_info = "'%s'" % (cp,) + else: + cp_info = "'%s' (%s)" % (cp, virt_cp) writemsg_level(colorize("BAD","\n\n!!! " + \ - "'%s' is part of your system profile.\n" % cp), + "%s is part of your system profile.\n" % (cp_info,)), level=logging.WARNING, noiselevel=-1) writemsg_level(colorize("WARN","!!! Unmerging it may " + \ "be damaging to your system.\n\n"),