]> git.decadent.org.uk Git - dak.git/commitdiff
Replace hardcoded hashfuncs with values generated from database
authorJoerg Jaspert <joerg@debian.org>
Sun, 13 Mar 2016 14:23:34 +0000 (15:23 +0100)
committerJoerg Jaspert <joerg@debian.org>
Tue, 15 Mar 2016 21:41:53 +0000 (22:41 +0100)
dak/generate_releases.py

index a1ef074f49a62b29230bd0e1c7c5e4600e5ca3ac..c359177235810258910b788ea09a85857ebc9cfe 100755 (executable)
@@ -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 = {}