[Yum-devel] [PATCH 3/3] Use the urlgrabber's checksum as a hint argument to verifyLocalPkg()

Zdeněk Pavlas zpavlas at redhat.com
Thu Jun 30 17:21:24 UTC 2011


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

diff --git a/yum/__init__.py b/yum/__init__.py
index 92f25d4..39b3333 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1855,13 +1855,17 @@ class YumBase(depsolve.Depsolve):
            otherwise it returns false for a failure, true for success"""
         failed = False
 
+        # check if checksum already calculated
+        try: hint = fo.csum
+        except: hint = None
+
         if type(fo) is types.InstanceType:
             fo = fo.filename
         
         if fo != po.localPkg():
             po.localpath = fo
 
-        if not po.verifyLocalPkg():
+        if not po.verifyLocalPkg(hint):
             failed = True
         else:
             ylp = YumLocalPackage(self.rpmdb.readOnlyTS(), fo)
-- 
1.7.4.4



More information about the Yum-devel mailing list