From e35864afdc298f9ca3d545c05c6c314c87fb8ff7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 Mar 2010 16:37:41 +1100 Subject: build: cope with systems that don't have md5 in python --- buildtools/wafsamba/samba_utils.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 59003d8212..b1e62f1fce 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -341,3 +341,24 @@ def RUN_COMMAND(cmd, return - os.WTERMSIG(status) print "Unknown exit reason %d for command: %s" (status, cmd) return -1 + + +# make sure we have md5. some systems don't have it +try: + from hashlib import md5 +except: + try: + import md5 + except: + import Constants + Constants.SIG_NIL = hash('abcd') + class replace_md5(object): + def __init__(self): + self.val = None + def update(self, val): + self.val = hash((self.val, val)) + def digest(self): + return str(self.val) + def hexdigest(self): + return self.digest().encode('hex') + Utils.md5 = replace_md5 -- cgit