createrepo/__init__.py | 2 +-
createrepo/utils.py | 4 ++--
modifyrepo.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 5dd00f425f64cdc1bfc1005f560fb4761abac007
Author: Seth Vidal <[email protected]>
Date: Mon Apr 13 14:03:10 2009 -0400
make sure the checksum type we use is being used everywhere.
closes rhbug: https://bugzilla.redhat.com/show_bug.cgi?id=494951
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)
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.