diff options
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/SCons/Node/FS.py | 6 | ||||
| -rw-r--r-- | src/engine/SCons/Util.py | 17 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 61cd80c..d183006 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -152,9 +152,9 @@ class FS: drive, path_first = os.path.splitdrive(path_comp[0]) if not path_first: # Absolute path - drive_path = _my_normcase(drive) + drive = _my_normcase(drive) try: - directory = self.Root[drive_path] + directory = self.Root[drive] except KeyError: if not create: raise UserError @@ -162,7 +162,7 @@ class FS: dir.path = dir.path + os.sep dir.abspath = dir.abspath + os.sep dir.srcpath = dir.srcpath + os.sep - self.Root[drive_path] = dir + self.Root[drive] = dir directory = dir path_comp = path_comp[1:] else: diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 7912abb..c66b99c 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -47,8 +47,19 @@ except ImportError: class UserString: pass - - +def updrive(path): + """ + Make the drive letter (if any) upper case. + This is useful because Windows is inconsitent on the case + of the drive letter, which can cause inconsistencies when + calculating command signatures. + """ + drive, rest = os.path.splitdrive(path) + if drive: + return os.path.join(string.upper(drive),rest) + else: + return path + class PathList(UserList.UserList): """This class emulates the behavior of a list, but also implements the special "path dissection" attributes we can use to find @@ -118,7 +129,7 @@ class PathList(UserList.UserList): def __getAbsPath(self): """Return the absolute path""" - return map(os.path.abspath, self.data) + return map(lambda x: updrive(os.path.abspath(x)), self.data) dictSpecialAttrs = { "file" : __getFileName, "base" : __getBasePath, |
