From 37a87119df729c35a221afb7a63dc96083de849c Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sun, 25 Jan 2009 14:41:08 +0000 Subject: [PATCH] Fix a mismatch in generated GUIDs on non-Windows platforms by canonicalizing the file name used for the MD5 checksum so it always looks like it's a Windows path (i.e., uses \ separators). git-svn-id: http://scons.tigris.org/svn/scons/trunk@3919 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Tool/msvs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 5aedf9c3..e08a167c 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -35,7 +35,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import base64 import hashlib -import os.path +import ntpath +import os import pickle import re import string @@ -80,7 +81,10 @@ def _generateGUID(slnfile, name): the project. It basically just needs to be unique, and not change with each invocation.""" m = hashlib.md5() - m.update(str(slnfile) + str(name)) + # Normalize the slnfile path to a Windows path (\ separators) so + # the generated file has a consistent GUID even if we generate + # it on a non-Windows platform. + m.update(ntpath.normpath(str(slnfile)) + str(name)) # TODO(1.5) #solution = m.hexdigest().upper() solution = string.upper(_hexdigest(m.digest())) -- 2.26.2