From 5dd00f425f64cdc1bfc1005f560fb4761abac007 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Mon, 13 Apr 2009 14:03:10 -0400 Subject: [PATCH] make sure the checksum type we use is being used everywhere. closes rhbug: https://bugzilla.redhat.com/show_bug.cgi?id=494951 --- createrepo/__init__.py | 2 +- createrepo/utils.py | 4 ++-- modifyrepo.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/createrepo/__init__.py b/createrepo/__init__.py index 2a880a8..7cfbb56 100644 --- a/createrepo/__init__.py +++ b/createrepo/__init__.py @@ -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: diff --git a/createrepo/utils.py b/createrepo/utils.py index 3f6414b..894594c 100644 --- a/createrepo/utils.py +++ b/createrepo/utils.py @@ -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 diff --git a/modifyrepo.py b/modifyrepo.py index 1efe966..341f3ab 100755 --- a/modifyrepo.py +++ b/modifyrepo.py @@ -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) -- 2.34.1