summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-24 16:37:41 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:05 +1000
commite35864afdc298f9ca3d545c05c6c314c87fb8ff7 (patch)
tree7221153ab4fde5ad92e544d88ef564f5b66858d9 /buildtools
parenta6ce1c3dce8c189c6454194e61f52a611c79d83d (diff)
downloadsamba-e35864afdc298f9ca3d545c05c6c314c87fb8ff7.tar.gz
samba-e35864afdc298f9ca3d545c05c6c314c87fb8ff7.tar.bz2
samba-e35864afdc298f9ca3d545c05c6c314c87fb8ff7.zip
build: cope with systems that don't have md5 in python
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_utils.py21
1 files changed, 21 insertions, 0 deletions
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