make sure the checksum type we use is being used everywhere.
authorSeth Vidal <skvidal@fedoraproject.org>
Mon, 13 Apr 2009 18:03:10 +0000 (14:03 -0400)
committerSeth Vidal <skvidal@fedoraproject.org>
Mon, 13 Apr 2009 18:03:10 +0000 (14:03 -0400)
closes rhbug: https://bugzilla.redhat.com/show_bug.cgi?id=494951

createrepo/__init__.py
createrepo/utils.py
modifyrepo.py

index 2a880a85b8e86d720325376df8cf447b1776c657..7cfbb56a62d7b5e469a27111becf8288c62a0015 100644 (file)
@@ -695,7 +695,7 @@ class MetaDataGenerator:
 
         
         if self.conf.unique_md_filenames:
-            (csum, outfn) = checksum_and_rename(outfn)
+            (csum, outfn) = checksum_and_rename(outfn, self.conf.sumtype)
             sfile = os.path.basename(outfn)
         else:
             if compress:
index 3f6414beef19a665c866e92405cc3cbb22dddc25..894594c427660adb350a5b1a0637c5667cdf319d 100644 (file)
@@ -100,10 +100,10 @@ def checkAndMakeDir(dir):
             result = True
     return result
 
-def checksum_and_rename(fn_path):
+def checksum_and_rename(fn_path, sumtype='sha256'):
     """checksum the file rename the file to contain the checksum as a prefix
        return the new filename"""
-    csum = misc.checksum('sha256', fn_path)
+    csum = misc.checksum(sumtype, fn_path)
     fn = os.path.basename(fn_path)
     fndir = os.path.dirname(fn_path)
     csum_fn = csum + '-' + fn
index 1efe9663de2a4c33712905a56b9b897e104d3401..341f3ab66f802c0ca651437ea571ec6646f530fc 100755 (executable)
@@ -88,7 +88,7 @@ class RepoMetadata:
         open_csum = checksum(self.checksum_type, metadata)
 
 
-        csum, destmd = checksum_and_rename(destmd)
+        csum, destmd = checksum_and_rename(destmd, self.checksum_type)
         base_destmd = os.path.basename(destmd)