From 3d42683a55d778e5035188f4a27e08dc180b1310 Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Nov 24 2014 04:54:26 +0000 Subject: set the correct lookaside hash type --- diff --git a/src/centpkg/__init__.py b/src/centpkg/__init__.py index c0f65b5..2d3cbec 100644 --- a/src/centpkg/__init__.py +++ b/src/centpkg/__init__.py @@ -141,6 +141,18 @@ class Commands(pyrpkg.Commands): except ValueError: raise pyrpkg.rpkgError('Malformed sources file.') + # The default lookaside hash is stored in centpkg.conf, but there is + # a mix of md5 and sha sums in the CentOS lookaside, here we divine + # which one we are using + + sum_lengths = { 128: 'sha512', + 64: 'sha256', + 40: 'sha1', + 32: 'md5', + } + + self.lookasidehash = sum_lengths[len(csum)] + # If a directory is specified in the metadata file, append it to # outdir if os.path.dirname(file):