[yum-commits] 4 commits - output.py yum/packages.py yum/pgpmsg.py

James Antill james at osuosl.org
Wed Dec 3 16:37:39 UTC 2008


 output.py       |    2 +-
 yum/packages.py |    4 +++-
 yum/pgpmsg.py   |   20 +++++++++++++++++---
 3 files changed, 21 insertions(+), 5 deletions(-)

New commits:
commit adaad312bbd3adb3fc46763a2a9f397311f3363b
Merge: 0ea797b... ad14103...
Author: James Antill <james at and.org>
Date:   Wed Dec 3 11:37:32 2008 -0500

    Merge branch 'yum-3_2_X'
    
    * yum-3_2_X:
      Work around for the crazy rpm package summaries bug, BZ 473239
      Make lastmsg a unicode string so we can do == tests, fixes Fedora BZ 473328
      Use "hashlib" directly in pgpmsg, so we don't have cross deps.

commit ad14103bd199008f42c8e17664d8f6f7063227ce
Author: James Antill <james at and.org>
Date:   Tue Dec 2 20:04:13 2008 -0500

    Work around for the crazy rpm package summaries bug, BZ 473239

diff --git a/yum/packages.py b/yum/packages.py
index 48dfc8d..acfb9f0 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -978,7 +978,9 @@ class YumHeaderPackage(YumAvailablePackage):
         self.ver = self.version
         self.rel = self.release
         self.pkgtup = (self.name, self.arch, self.epoch, self.version, self.release)
-        self.summary = misc.share_data(self.hdr['summary'].replace('\n', ''))
+        # Summaries "can be" empty, which rpm return [], see BZ 473239, *sigh*
+        self.summary = self.hdr['summary'] or ''
+        self.summary = misc.share_data(self.summary.replace('\n', ''))
         self.description = misc.share_data(self.hdr['description'])
         self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER]
         if not self.pkgid:
commit 04e40bd548a25d226084f99774daff85ebaace40
Author: James Antill <james at and.org>
Date:   Mon Dec 1 12:06:28 2008 -0500

    Make lastmsg a unicode string so we can do == tests, fixes Fedora BZ 473328

diff --git a/output.py b/output.py
index 4f7a6cf..b6bd005 100755
--- a/output.py
+++ b/output.py
@@ -1216,7 +1216,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
 
     def __init__(self):
         RPMBaseCallback.__init__(self)
-        self.lastmsg = None
+        self.lastmsg = to_unicode("")
         self.lastpackage = None # name of last package we looked at
         self.output = logging.getLogger("yum.verbose.cli").isEnabledFor(logginglevels.INFO_2)
         
commit c11fdcddcf3d8e987333f47f73834adfc5e56187
Author: James Antill <james at and.org>
Date:   Mon Dec 1 09:50:08 2008 -0500

    Use "hashlib" directly in pgpmsg, so we don't have cross deps.

diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
index 66aff61..04ab346 100644
--- a/yum/pgpmsg.py
+++ b/yum/pgpmsg.py
@@ -18,7 +18,21 @@ import struct, time, cStringIO, base64, types
 #  We use this so that we can work on python-2.4 and python-2.6, and thus.
 # use import md5/import sha on the older one and import hashlib on the newer.
 #  Stupid deprecation warnings.
-from misc import Checksums
+try:
+    import hashlib
+except ImportError:
+    # Python-2.4.z ... gah!
+    import sha
+    import md5
+    class hashlib:
+
+        @staticmethod
+        def new(algo):
+            if algo == 'md5':
+                return md5.new()
+            if algo == 'sha1':
+                return sha.new()
+            raise ValueError, "Bad checksum type"
 
 debug = None
 
@@ -383,14 +397,14 @@ class public_key(pgp_packet) :
         # otherwise calculate it now and cache it
         # v3 and v4 are calculated differently
         if self.version == 3 :
-            h = misc.Checksums(['md5'])
+            h = hashlib.new('md5')
             h.update(pack_long(self.pk_rsa_mod))
             h.update(pack_long(self.pk_rsa_exp))
             self.fingerprint_ = h.digest()
         elif self.version == 4 :
             # we hash what would be the whole PGP message containing
             # the pgp certificate
-            h = misc.Checksums(['sha1'])
+            h = hashlib.new('sha1')
             h.update('\x99')
             # we need to has the length of the packet as well
             buf = self.serialize()


More information about the Yum-commits mailing list