[Yum-devel] [PATCH] Drop the with_size & no_size split.

Zdeněk Pavlas zpavlas at redhat.com
Mon Aug 27 09:30:59 UTC 2012


IMO It's better to see "30 files in total, 5 already done." than to have
a nice byte-accurate progress for first 10 files with known size, but
without any hint that 20 files of uknown size will follow.

Also, downloading in one pass will parallelize better.
---
 yum/repos.py |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/yum/repos.py b/yum/repos.py
index 6d4c20e..0014880 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -92,15 +92,12 @@ class RepoStorage:
                 downloading = repo._commonRetrieveDataMD_list(mdtypes)
                 repos.append((repo, downloading, [False]))
 
-        # with sizes first, then without sizes..
-        for no_size in (False, True):
-            for repo, downloading, error in repos:
-                def failfunc(obj, error=error):
-                    error[0] = True
-                for (ndata, nmdtype) in downloading:
-                    if (ndata.size is None) == no_size:
-                        repo._retrieveMD(nmdtype, async=True, failfunc=failfunc)
-            urlgrabber.grabber.parallel_wait()
+        for repo, downloading, error in repos:
+            def failfunc(obj, error=error):
+                error[0] = True
+            for (ndata, nmdtype) in downloading:
+                repo._retrieveMD(nmdtype, async=True, failfunc=failfunc)
+        urlgrabber.grabber.parallel_wait()
 
         # done or revert
         for repo, downloading, error in repos:
-- 
1.7.4.4



More information about the Yum-devel mailing list