>  ACK. I think we need similar changes to reposync, although it
>  doesn't look like that's ever had any group_gz updates.

reposync --download-metadata downloads everything but
['primary', 'primary_db', 'filelists', 'filelists_db', 'other', 'other_db']
so both group and group_gz is downloaded.  That's probably fine.

But I've noticed the multi-progress in reposync is broken, as it does not use
YumUtilBase.  This could be fixed in reposync, but that will break with old Yum:

commit 13bf66cac22040df842b0b2f27dcf36e12e906b9
Author: Zdeněk Pavlas <[email protected]>
Date:   Tue Aug 28 09:21:51 2012 +0200

    Initialize multi progress bar
    
    Contrary to yumdownloader, reposync does not use YumUtilBase.
    This needs recent Yum to work.

diff --git a/reposync.py b/reposync.py
index ad4e441..f868594 100755
--- a/reposync.py
+++ b/reposync.py
@@ -47,7 +47,7 @@ from yum.constants import *
 from yum.packageSack import ListPackageSack
 import rpmUtils.arch
 import logging
-from urlgrabber.progress import TextMeter
+from urlgrabber.progress import TextMeter, TextMultiFileMeter
 import urlgrabber
 
 # for yum 2.4.X compat
@@ -165,7 +165,7 @@ def main():
     #  Use progress bar display when downloading repo metadata
     # and package files ... needs to be setup before .repos (ie. RHN/etc.).
     if not opts.quiet:
-        my.repos.setProgressBar(TextMeter(fo=sys.stdout))
+        my.repos.setProgressBar(TextMeter(fo=sys.stdout), 
TextMultiFileMeter(fo=sys.stdout))
     my.doRepoSetup()
 
     if len(opts.repoid) > 0:

An alternative is to add a hack to Yum, to turn TextMeter to TextMultiFileMeter 
automatically.  Can't tell what's better (read: less bad)..

commit 42f9c1d9a3045ca1d7a6f18bb20a290e4939ce97
Author: Zdeněk Pavlas <[email protected]>
Date:   Tue Aug 28 10:01:06 2012 +0200

    setProgressBar: Guess multi_obj to help legacy users

diff --git a/yum/repos.py b/yum/repos.py
index 0014880..b620361 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -23,6 +23,7 @@ import misc
 import Errors
 from packageSack import MetaSack
 import urlgrabber.grabber
+from urlgrabber.progress import TextMeter, TextMultiFileMeter
 
 from weakref import proxy as weakref
 
@@ -271,6 +272,8 @@ class RepoStorage:
     def setProgressBar(self, obj, multi_obj=None):
         """sets the progress bar for downloading files from repos"""
         
+        if not multi_obj and obj and obj.__class__ is TextMeter:
+            multi_obj = TextMultiFileMeter(fo=obj.fo) # DTRT, mostly
         for repo in self.repos.values():
             repo.setCallback(obj, multi_obj)
 
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to