createrepo/__init__.py createrepo/yumbased.py

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

New commits:
commit 79ef9e4bb02823a7d0d5a6f9d2cbffff3f428474
Author: Seth Vidal <[email protected]>
Date:   Fri Apr 17 16:21:49 2009 -0400

    make sure our sumtype specified propagates down to the pkg checksums, too

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 00c14da..54afb86 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -438,7 +438,7 @@ class MetaDataGenerator:
             rpmfile = '%s/%s' % (pkgpath, rpmfile)
             
         try:
-            po = yumbased.CreateRepoPackage(self.ts, rpmfile)
+            po = yumbased.CreateRepoPackage(self.ts, rpmfile, sumtype=self.conf.sumtype)
         except Errors.MiscError, e:
             raise MDError, "Unable to open package: %s" % e
         # external info we need
@@ -608,7 +608,7 @@ class MetaDataGenerator:
             candidates = []
             for fn in pot_cand:
                 try:
-                    thispo = yumbased.CreateRepoPackage(self.ts, fn)
+                    thispo = yumbased.CreateRepoPackage(self.ts, fn, sumtype=self.conf.sumtype)
                 except Errors.MiscError, e:
                     continue
                 if (thispo.name, thispo.arch) != (pkg.name, pkg.arch):
@@ -660,7 +660,8 @@ class MetaDataGenerator:
         result = u''
         for drpm_fn in self.getFileList(self.conf.deltadir, 'drpm'):
             drpm_rel_fn = os.path.normpath(self.conf.delta_relative + '/' + drpm_fn) # this is annoying
-            drpm_po = yumbased.CreateRepoPackage(self.ts, self.conf.deltadir + '/' + drpm_fn)
+            drpm_po = yumbased.CreateRepoPackage(self.ts, 
+                 self.conf.deltadir + '/' + drpm_fn, sumtype=self.conf.sumtype)
             
             drpm = deltarpms.DeltaRPMPackage(drpm_po, self.conf.outputdir, drpm_rel_fn)
             if not targets.has_key(drpm_po.pkgtup):
diff --git a/createrepo/yumbased.py b/createrepo/yumbased.py
index 32eed04..e8b5667 100644
--- a/createrepo/yumbased.py
+++ b/createrepo/yumbased.py
@@ -30,9 +30,11 @@ import utils
 import tempfile
 
 class CreateRepoPackage(YumLocalPackage):
-    def __init__(self, ts, package):
+    def __init__(self, ts, package, sumtype=None):
         YumLocalPackage.__init__(self, ts, package)
-        
+        if sumtype:
+            self.checksum_type = sumtype
+
     def _do_checksum(self):
         """return a checksum for a package:
            - check if the checksum cache is enabled
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.