make sure our sumtype specified propagates down to the pkg checksums, too
authorSeth Vidal <skvidal@fedoraproject.org>
Fri, 17 Apr 2009 20:21:49 +0000 (16:21 -0400)
committerSeth Vidal <skvidal@fedoraproject.org>
Fri, 17 Apr 2009 20:21:49 +0000 (16:21 -0400)
createrepo/__init__.py
createrepo/yumbased.py

index 00c14da813209a327bfeb869d982ba4070d015cf..54afb86d2c408f11e9443c41c6909253688966fb 100644 (file)
@@ -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):
index 32eed043d8e102567b01b5b1de06fb8e5f0d7881..e8b5667f3707839a2d8ef0d062d38bd49fcc4464 100644 (file)
@@ -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