[Yum-devel] [PATCH 2/6] errors implies repo_cached, so remove it. Move the error return up a bit.

Zdeněk Pavlas zpavlas at redhat.com
Wed Jul 13 16:50:34 UTC 2011


---
 yum/__init__.py |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 83973d4..8c75879 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1945,7 +1945,6 @@ class YumBase(depsolve.Depsolve):
         self.history.close()
 
         self.plugins.run('predownload', pkglist=pkglist)
-        repo_cached = False
         remote_pkgs = []
         remote_size = 0
         for po in pkglist:
@@ -1958,22 +1957,18 @@ class YumBase(depsolve.Depsolve):
                     if os.path.getsize(local) >= po.size:
                         os.unlink(local)
                     if po.repo.cache:
-                        repo_cached = True
                         adderror(po, _('package fails checksum but caching is '
                             'enabled for %s') % po.repo.id)
+                        # caching is enabled and the package 
+                        # just failed to check out there's no 
+                        # way to save this, report the error and return
+                        return errors
                 else:
                     self.verbose_logger.debug(_("using local copy of %s") %(po,))
                     continue
-                        
+
             remote_pkgs.append(po)
             remote_size += po.size
-            
-            # caching is enabled and the package 
-            # just failed to check out there's no 
-            # way to save this, report the error and return
-            if (self.conf.cache or repo_cached) and errors:
-                return errors
-                
 
         remote_pkgs.sort(mediasort)
         #  This is kind of a hack and does nothing in non-Fedora versions,
-- 
1.7.4.4



More information about the Yum-devel mailing list