[yum-commits] yumdownloader.py

zpavlas at osuosl.org zpavlas at osuosl.org
Fri Jan 17 14:09:39 UTC 2014


 yumdownloader.py |   30 ++++++------------------------
 1 file changed, 6 insertions(+), 24 deletions(-)

New commits:
commit 6e5db0ddd9f55f4dfa02dcbf5fd925ca11a257d5
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Fri Jan 17 14:55:49 2014 +0100

    yumdownloader: use stock doUtilYumSetup()
    
    yumdownloader didn't lock the cachedir but it might have
    updated the repository metadata.

diff --git a/yumdownloader.py b/yumdownloader.py
index b491c7f..b448aa8 100755
--- a/yumdownloader.py
+++ b/yumdownloader.py
@@ -100,8 +100,13 @@ class YumDownloader(YumUtilBase):
         # override all pkgdirs
         self.conf.downloaddir = opts.destdir
             
+        if opts.source:
+            # Setup source repos
+            self.arch.archlist.append('src')
+            self.setupSourceRepos()
+
         # Setup yum (Ts, RPM db, Repo & Sack)
-        self.doUtilYumSetup(opts)
+        self.doUtilYumSetup()
         # Do the real action
         self.exit_code = self.downloadPackages(opts)
         
@@ -230,29 +235,6 @@ class YumDownloader(YumUtilBase):
                 pkgGroups[na].append(po)
         return pkgGroups
             
-    # sligly modified from the one in YumUtilBase    
-    def doUtilYumSetup(self,opts):
-        """do a default setup for all the normal/necessary yum components,
-           really just a shorthand for testing"""
-        try:
-            # Setup source repos
-            if opts.source:
-                self.setupSourceRepos()
-            self._getRepos(doSetup = True)
-            # if '--source' is used the add src to the archlist
-            if opts.source:
-                archlist = rpmUtils.arch.getArchList() + ['src']    
-            elif opts.archlist:
-                archlist = []
-                for a in opts.archlist.split(','):
-                    archlist.extend(rpmUtils.arch.getArchList(a))
-            else:
-                archlist = rpmUtils.arch.getArchList()
-            self._getSacks(archlist=archlist)
-        except yum.Errors.YumBaseError, msg:
-            self.logger.critical(exception2msg(msg))
-            sys.exit(1)
-
     def addCmdOptions(self):
         # this if for compatibility with old API (utils.py from yum < 3.2.23)
         if hasattr(self,'getOptionGroup'): # check if the group option API is available


More information about the Yum-commits mailing list