summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-08 13:24:26 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-08 13:24:26 -0700
commitac01d2898ece4589cdaa971382cc1dc17261ed58 (patch)
treef7323ef4123cc7f14e409921aecf4b35855c0b6f
parent0388944a560582abcbf5c7b0257d48918ac11455 (diff)
downloadportage-ac01d2898ece4589cdaa971382cc1dc17261ed58.tar.gz
portage-ac01d2898ece4589cdaa971382cc1dc17261ed58.tar.bz2
portage-ac01d2898ece4589cdaa971382cc1dc17261ed58.zip
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.
-rw-r--r--pym/_emerge/unmerge.py10
1 files changed, 9 insertions, 1 deletions
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"),