Search
j0ke.net Open Build Service
>
Projects
>
J0KE.NET
:
infrastructure
>
yum
> yum-3.2.14-deprecated.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File yum-3.2.14-deprecated.patch of Package yum
Index: yum/misc.py =================================================================== --- yum/misc.py.orig +++ yum/misc.py @@ -134,11 +134,20 @@ def checksum(sumtype, file, CHUNK=2**16) fo = open(file, 'r', CHUNK) if sumtype == 'md5': - import md5 - sumalgo = md5.new() + try: + import hashlib + sumalgo = hashlib.md5() + except ImportError: + # for Python < 2.6 + import md5 + sumalgo = md5.new() elif sumtype == 'sha': - import sha - sumalgo = sha.new() + try: + import hashlib + sumalgo = hashlib.sha1() + except ImportError: + import sha + sumalgo = sha.new() else: raise MiscError, 'Error Checksumming file, bad checksum type %s' % sumtype chunk = fo.read Index: yum/pgpmsg.py =================================================================== --- yum/pgpmsg.py.orig +++ yum/pgpmsg.py @@ -13,7 +13,7 @@ ##You should have received a copy of the GNU General Public License ##along with this program; if not, write to the Free Software ##Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -import struct, time, cStringIO, base64, types, md5, sha +import struct, time, cStringIO, base64, types debug = None @@ -378,14 +378,26 @@ class public_key(pgp_packet) : # otherwise calculate it now and cache it # v3 and v4 are calculated differently if self.version == 3 : - h = md5.new() + try: + import hashlib + h = sum = hashlib.md5() + except ImportError: + # for Python < 2.6 + import md5 + h = md5.new() 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 = sha.new() + try: + import hashlib + sum = hashlib.sha1() + except ImportError: + # for Python < 2.6 + import sha + h = sha.new() h.update('\x99') # we need to has the length of the packet as well buf = self.serialize()