From: Joerg Jaspert Date: Sun, 13 Mar 2016 14:23:34 +0000 (+0100) Subject: Replace hardcoded hashfuncs with values generated from database X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=37270b6ce6350afc772121ec5720471b0d12a907;p=dak.git Replace hardcoded hashfuncs with values generated from database --- 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 = {}