From: Zac Medico Date: Mon, 9 May 2011 06:08:43 +0000 (-0700) Subject: unmerge: skip getvirtuals() if cat is not virtual X-Git-Tag: v2.2.0_alpha33~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1a693adbc6ea559e92f88268c0d5b3d54c0f7c06;p=portage.git unmerge: skip getvirtuals() if cat is not virtual This allows us to avoid triggering the old-style virtual code which scans /var/db/pkg/*/*/PROVIDE. --- diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index 7e66ff9fb..6c0ef8dbc 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -67,8 +67,14 @@ def unmerge(root_config, myopts, unmerge_action, syslist = [] for x in realsyslist: - mycp = portage.dep_getkey(x) - if mycp in settings.getvirtuals(): + mycp = x.cp + # Since Gentoo stopped using old-style virtuals in + # 2011, typically it's possible to avoid getvirtuals() + # calls entirely. It will not be triggered here by + # new-style virtuals since those are expanded to + # non-virtual atoms above by expand_new_virt(). + if mycp.startswith("virtual/") and \ + mycp in settings.getvirtuals(): providers = [] for provider in settings.getvirtuals()[mycp]: if vartree.dbapi.match(provider):