[Yum-devel] [PATCH] drpm retry: add RPM sizes to total size. BZ 959786

Zdenek Pavlas zpavlas at redhat.com
Wed May 15 11:23:37 UTC 2013


Move the callback_total call out of the retry loop.
Don't reset remote_size and remote_pkgs when retrying.
---
 yum/__init__.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 50e2fad..cbb20c0 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2319,6 +2319,7 @@ much more problems).
             self.closeRpmDB()
             self.doUnlock()
 
+        all_tries = remote_pkgs
         while True:
             remote_pkgs.sort(mediasort)
             #  This is kind of a hack and does nothing in non-Fedora versions,
@@ -2380,8 +2381,6 @@ much more problems).
 
             if hasattr(urlgrabber.progress, 'text_meter_total_size'):
                 urlgrabber.progress.text_meter_total_size(0)
-            if callback_total is not None and not errors:
-                callback_total(remote_pkgs, remote_size, beg_download)
 
             if downloadonly:
                 for po in remote_pkgs:
@@ -2409,13 +2408,15 @@ much more problems).
 
             # there were drpm related errors *only*
             remote_pkgs = []
-            remote_size = 0
             for po in errors:
                 po = po.rpm
                 remote_pkgs.append(po)
                 remote_size += po.size
+            all_tries.extend(remote_pkgs)
             errors.clear()
             self.verbose_logger.warn(_('Some delta RPMs failed to download or rebuild. Retrying..'))
+        if callback_total and not errors:
+            callback_total(all_tries, remote_size, beg_download)
 
         if not downloadonly:
             # XXX: Run unlocked?  Skip this for now..
-- 
1.7.11.7



More information about the Yum-devel mailing list