Fix package counters in depgraph.display() so they're only incremented
authorZac Medico <zmedico@gentoo.org>
Sun, 4 May 2008 03:46:19 +0000 (03:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 4 May 2008 03:46:19 +0000 (03:46 -0000)
for "ordered" display nodes.

svn path=/main/trunk/; revision=10157

pym/_emerge/__init__.py

index 40960ab1a5f76ebefd7dc9953663438d6f3c2183..adfc332d8c2b1a3cec5fc84c78e96bbfe108fc22 100644 (file)
@@ -4221,10 +4221,11 @@ class depgraph(object):
                                installed_versions = vardb.match(portage.cpv_getkey(pkg_key))
                                if vardb.cpv_exists(pkg_key):
                                        addl="  "+yellow("R")+fetch+"  "
-                                       if pkg_merge:
-                                               counters.reinst += 1
-                                       elif pkg_status == "uninstall":
-                                               counters.uninst += 1
+                                       if ordered:
+                                               if pkg_merge:
+                                                       counters.reinst += 1
+                                               elif pkg_status == "uninstall":
+                                                       counters.uninst += 1
                                # filter out old-style virtual matches
                                elif installed_versions and \
                                        portage.cpv_getkey(installed_versions[0]) == \
@@ -4391,7 +4392,8 @@ class depgraph(object):
                                                                if myfetchfile not in myfetchlist:
                                                                        mysize+=myfilesdict[myfetchfile]
                                                                        myfetchlist.append(myfetchfile)
-                                                       counters.totalsize += mysize
+                                                       if ordered:
+                                                               counters.totalsize += mysize
                                                verboseadd+=format_size(mysize)+" "
 
                                        # overlay verbose