From: Boris Minev Date: Tue, 3 Apr 2012 17:56:48 +0000 (-0700) Subject: unmerge: display progress counter, bug #386901 X-Git-Tag: v2.2.0_alpha100~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=784c94ac3520a1fe0659be53fab07becaad6274b;p=portage.git unmerge: display progress counter, bug #386901 --- diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index 0acdf998c..89eae0864 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -542,10 +542,23 @@ def unmerge(root_config, myopts, unmerge_action, if clean_delay and not autoclean: countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging") + all_selected = set() + all_selected.update(*[x["selected"] for x in pkgmap]) + + # Set counter variables + curval = 1 + maxval = len(all_selected) + for x in range(len(pkgmap)): for y in pkgmap[x]["selected"]: - writemsg_level(">>> Unmerging "+y+"...\n", noiselevel=-1) emergelog(xterm_titles, "=== Unmerging... ("+y+")") + message = ">>> Unmerging ({0} of {1}) {2}...\n".format( + colorize("MERGE_LIST_PROGRESS", str(curval)), + colorize("MERGE_LIST_PROGRESS", str(maxval)), + y) + writemsg_level(message, noiselevel=-1) + curval += 1 + mysplit = y.split("/") #unmerge... retval = portage.unmerge(mysplit[0], mysplit[1],