X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=Tools%2FPython%2FWorkspaceRoutines.py;h=c75cd57c524c753ee0cc29cce11199ddec1c412d;hb=e64872fa8b577189395edb6624b9e178989fd3e5;hp=8ca88b7ab594c8a6efe64760f779ef617ce2ecbe;hpb=4040421aeed0f34fe2e039dafc1e1312dfa3e6a9;p=mirror_edk2.git diff --git a/Tools/Python/WorkspaceRoutines.py b/Tools/Python/WorkspaceRoutines.py index 8ca88b7ab5..c75cd57c52 100755 --- a/Tools/Python/WorkspaceRoutines.py +++ b/Tools/Python/WorkspaceRoutines.py @@ -27,7 +27,7 @@ def genguid(): getpass.getuser() + str(time.time()) + socket.gethostbyname(socket.gethostname())).hexdigest() - return "%s-%s-%s-%s-%s" % (g[0:8], g[8:12], g[12:16], g[16:20], g[20:]) + return Guid("%s-%s-%s-%s-%s" % (g[0:8], g[8:12], g[12:16], g[16:20], g[20:])) def lean(path): """Lean the slashes forward""" @@ -42,3 +42,20 @@ def mkdir(path): except: pass +def Md5(filename): + + sum = "" + + try: + f=open(filename, "rb") + sum = md5.md5(f.read()).hexdigest() + f.close() + except IOError: + print "Error: Unable to open file: %s" % filename + sys.exit() + + return sum + +def Guid(guidString): + """Convert the guid string into a canonical form suitable for comparison.""" + return string.lower(guidString)