[Yum-devel] [PATCH] Include installs in 'data still to download'. BZ 739092

Zdeněk Pavlas zpavlas at redhat.com
Mon Sep 19 15:37:54 UTC 2011


---
 yum-presto/presto.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/yum-presto/presto.py b/yum-presto/presto.py
index 169e938..cf6612c 100644
--- a/yum-presto/presto.py
+++ b/yum-presto/presto.py
@@ -33,7 +33,7 @@ except:
     from xml.etree.cElementTree import iterparse
 
 from yum.plugins import TYPE_CORE, PluginYumExit
-from yum.constants import TS_UPDATE, TS_INSTALL
+from yum.constants import TS_UPDATE, TS_INSTALL_STATES
 from yum.i18n import exception2msg
 import yum.Errors
 import yum.misc
@@ -588,8 +588,11 @@ def predownload_hook(conduit):
     repos = set()
     reposize = {}
     download_pkgs = []
+    install_size = 0
     for po in pkglist:
         if po.state != TS_UPDATE and po.name not in installonlypkgs:
+            if po.state in TS_INSTALL_STATES:
+                install_size += po.size
             continue
         local = po.localPkg()
         if os.path.exists(local):
@@ -639,7 +642,7 @@ def predownload_hook(conduit):
     xpostdownload_hook(conduit)
     if more:
         conduit.info(2, "Package(s) data still to download: %s" %
-                     format_number(more))
+                     format_number(more + install_size))
 
 #  Output stats. about delta downloads ... if we don't have deltas for
 # everything (pretty common), we want to output these before we start
-- 
1.7.4.4



More information about the Yum-devel mailing list