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

skvidal at osuosl.org skvidal at osuosl.org
Tue Feb 3 22:56:53 UTC 2009


 yum/packages.py   |   10 +++++++---
 yum/sqlitesack.py |    5 ++++-
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 5e4fd536d715717d60cfed6219cf55e3c10d67d6
Merge: bbf6e09... 6a23ca8...
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Feb 3 17:56:20 2009 -0500

    Merge branch 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X
    
    * 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:
      Fix testcase to not use the same object in multiple repos.
      Test cases for RHBZ 483633, perl updates
      Give the FakePackages a pkgKey
      Have the base returnPackages follow the patterns API guarantees
      Run all 3 testKernelInstall tests
      Look at the arch properly for no reqPo in compare_providers

commit bbf6e0900c5319b1bccbc09c5afe01366a10b4b0
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Feb 3 17:55:51 2009 -0500

    make sure yumHeaderPackages have a returnChecksums implemented and that they populate
    self._checksums properly

diff --git a/yum/packages.py b/yum/packages.py
index 80ba8bb..4a2b759 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -789,7 +789,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
         
         if self.url:
             url = misc.to_xml(self.url)
-        (csum_type, csum, csumid) = self._checksums[0]
+        (csum_type, csum, csumid) = self.checksums[0]
         msg = """
   <name>%s</name>
   <arch>%s</arch>
@@ -1527,11 +1527,15 @@ class YumLocalPackage(YumHeaderPackage):
     def _do_checksum(self, checksum_type='sha256'):
         if not self._checksum:
             self._checksum = misc.checksum(checksum_type, self.localpath)
-            
+            self._checksums = [(checksum_type, self._checksum, 1)]
+
         return self._checksum    
 
     checksum = property(fget=lambda self: self._do_checksum())   
-    
+
+    def returnChecksums(self):
+        return self._checksums
+
     def _get_header_byte_range(self):
         """takes an rpm file or fileobject and returns byteranges for location of the header"""
         if self._hdrstart and self._hdrend:
commit d4dbb2b39d60bc8b85738a631c868db45cdb46e3
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Feb 3 17:55:33 2009 -0500

    fix to work on rhel5 sqlite errors, apparently :(

diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index c2f4fbd..9726be9 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -46,7 +46,10 @@ def catchSqliteException(func):
             # 2.4.x requires this, but 2.6.x complains about even hasattr()
             # of e.message ... *sigh*
             if sys.hexversion < 0x02050000:
-                raise Errors.RepoError, str(e.message)
+                if hasattr(e,'message'):
+                    raise Errors.RepoError, str(e.message)
+                else:
+                    raise Errors.RepoError, str(e)
             raise Errors.RepoError, str(e)
 
     newFunc.__name__ = func.__name__


More information about the Yum-commits mailing list