---
 yum/__init__.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 2fc0323..5d268a7 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1978,12 +1978,11 @@ class YumBase(depsolve.Depsolve):
             len(remote_pkgs) > 1):
             urlgrabber.progress.text_meter_total_size(remote_size)
         beg_download = time.time()
-        i = 0
+        i = [0]
         local_size = [0]
         done_repos = set()
-        for po in remote_pkgs:
+        def download(po, i):
             local = po.localPkg()
-            i += 1
             checkfunc = (self.verifyPkg, (po, 1), {})
             dirstat = os.statvfs(po.repo.pkgdir)
             if (dirstat.f_bavail * dirstat.f_bsize) <= long(po.size):
@@ -1993,7 +1992,7 @@ class YumBase(depsolve.Depsolve):
                          (po.repo.pkgdir,
                           format_number(dirstat.f_bavail * dirstat.f_bsize),
                           format_number(po.size)))
-                continue
+                return
             
             try:
                 if len(remote_pkgs) == 1:
@@ -2024,6 +2023,12 @@ class YumBase(depsolve.Depsolve):
                 po.localpath = mylocal
                 if po in errors:
                     del errors[po]
+        def thread():
+            while 1:
+                j = i[0]; i[0] += 1
+                if j >= len(remote_pkgs): break
+                download(remote_pkgs[j], j + 1)
+        thread()
 
         if hasattr(urlgrabber.progress, 'text_meter_total_size'):
             urlgrabber.progress.text_meter_total_size(0)
-- 
1.7.4.4

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to