[yum-commits] Branch 'yum-3_2_X' - yum/packages.py

James Antill james at osuosl.org
Thu Feb 4 19:10:31 UTC 2010


 yum/packages.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 32b079e932aeac8b00d610927107ba4474b36151
Author: James Antill <james at and.org>
Date:   Thu Feb 4 14:07:59 2010 -0500

    Fix a couple of typos for pkg.verify(), sizes are weird in edge cases:
    
    . We always use my_st.st_size instead of my_st_size, when reporting
      errors (but not for the tests!).
    
    . We update to the prelink values, even if prelink didn't work.

diff --git a/yum/packages.py b/yum/packages.py
index 73c0eee..1cedb38 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -1555,8 +1555,9 @@ class YumInstalledPackage(YumHeaderPackage):
                         (ig, fp, er) = (p.stdin, p.stdout, p.stderr)
                         # er.read(1024 * 1024) # Try and get most of the stderr
                         fp = _CountedReadFile(fp)
-                        my_csum = misc.checksum(csum_type, fp)
-                        my_st_size = fp.read_size
+                        if fp.read_size: # If prelink worked
+                            my_csum = misc.checksum(csum_type, fp)
+                            my_st_size = fp.read_size
 
                     if (csum and vflags & _RPMVERIFY_DIGEST and gen_csum and
                         my_csum != csum):
@@ -1571,7 +1572,7 @@ class YumInstalledPackage(YumHeaderPackage):
                     my_st_size != size):
                     prob = _PkgVerifyProb('size', 'size does not match', ftypes)
                     prob.database_value = size
-                    prob.disk_value     = my_st.st_size
+                    prob.disk_value     = my_st_size
                     problems.append(prob)
 
             else:


More information about the Yum-commits mailing list