From 37270b6ce6350afc772121ec5720471b0d12a907 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 13 Mar 2016 15:23:34 +0100 Subject: [PATCH] Replace hardcoded hashfuncs with values generated from database --- dak/generate_releases.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dak/generate_releases.py b/dak/generate_releases.py index a1ef074f..c3591772 100755 --- a/dak/generate_releases.py +++ b/dak/generate_releases.py @@ -224,9 +224,8 @@ class ReleaseWriter(object): os.chdir(os.path.join(suite.archive.path, "dists", suite.suite_name, suite_suffix)) - hashfuncs = { 'MD5Sum' : apt_pkg.md5sum, - 'SHA1' : apt_pkg.sha1sum, - 'SHA256' : apt_pkg.sha256sum } + hashfuncs = dict(zip([x.upper().replace('UM', 'um') for x in suite.checksums], + [getattr(apt_pkg, "%s" % (x)) for x in [x.replace("sum", "") + "sum" for x in suite.checksums]])) fileinfo = {} -- 2.39.5