From 0cb9ac61c6e4eeb45585c39d9b072a488b5d8d44 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Sun, 25 Jan 2009 14:41:08 +0000 Subject: 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). --- 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 5aedf9c..e08a167 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())) -- cgit v0.12