get rid of the md5 badness - use yum's Checksum class so we don't have to deal
authorSeth Vidal <skvidal@fedoraproject.org>
Thu, 22 Jan 2009 21:22:20 +0000 (16:22 -0500)
committerSeth Vidal <skvidal@fedoraproject.org>
Thu, 22 Jan 2009 21:22:20 +0000 (16:22 -0500)
with python 2.4 vs 2.6isms

createrepo/yumbased.py

index f4ff87cf2d051fa2a19c38f71a68501d08241835..2e23f9db44ae6031c85c96a58ee1a3fe8c140072 100644 (file)
@@ -19,7 +19,6 @@ import os
 import rpm
 import types
 import re
-import md5
 
 from yum.packages import YumLocalPackage
 from yum.Errors import *
@@ -60,7 +59,9 @@ class CreateRepoPackage(YumLocalPackage):
         if type(self.hdr[rpm.RPMTAG_HDRID]) is not types.NoneType:
             t.append("".join(self.hdr[rpm.RPMTAG_HDRID]))
 
-        key = md5.new("".join(t)).hexdigest()
+        kcsum = misc.Checksums()
+        kcsum.update("".join(t))
+        key = kcsum.hexdigest()
                                                 
         csumtag = '%s-%s-%s-%s' % (os.path.basename(self.localpath),
                                    key, self.size, self.filetime)