3 commits - createrepo/utils.py createrepo/yumbased.py

[email protected]
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
 createrepo/utils.py    |    5 ++++-
 createrepo/yumbased.py |    5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit cb04e99795c8ede648e20c88e8bab3b67786d42f
Author: Seth Vidal <[email protected]>
Date:   Thu Jan 22 16:33:19 2009 -0500

    make sure we keep working on python 2.4 :(

diff --git a/createrepo/utils.py b/createrepo/utils.py
index d2fd658..48eddba 100644
--- a/createrepo/utils.py
+++ b/createrepo/utils.py
@@ -36,7 +36,10 @@ class GzipFile(gzip.GzipFile):
     def _write_gzip_header(self):
         self.fileobj.write('\037\213')             # magic header
         self.fileobj.write('\010')                 # compression method
-        fname = self.name[:-3]
+        if hasattr(self, 'name'):
+            fname = self.name[:-3]
+        else:
+            fname = self.filename[:-3]
         flags = 0
         if fname:
             flags = FNAME
commit 0644ba140d30016f589c8f3266aeffe21de2955d
Author: Seth Vidal <[email protected]>
Date:   Thu Jan 22 16:29:06 2009 -0500

    use gzip.name not gzip.filename to avoid python 2.6 deprecation warnings

diff --git a/createrepo/utils.py b/createrepo/utils.py
index 1b0d015..d2fd658 100644
--- a/createrepo/utils.py
+++ b/createrepo/utils.py
@@ -36,7 +36,7 @@ class GzipFile(gzip.GzipFile):
     def _write_gzip_header(self):
         self.fileobj.write('\037\213')             # magic header
         self.fileobj.write('\010')                 # compression method
-        fname = self.filename[:-3]
+        fname = self.name[:-3]
         flags = 0
         if fname:
             flags = FNAME
commit 5af6824631dfda17d0817343f42583129c0d0d8b
Author: Seth Vidal <[email protected]>
Date:   Thu Jan 22 16:22:20 2009 -0500

    get rid of the md5 badness - use yum's Checksum class so we don't have to deal
    with python 2.4 vs 2.6isms

diff --git a/createrepo/yumbased.py b/createrepo/yumbased.py
index f4ff87c..2e23f9d 100644
--- a/createrepo/yumbased.py
+++ b/createrepo/yumbased.py
@@ -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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.