diff options
| author | Steven Knight <knight@baldmt.com> | 2002-05-16 23:28:54 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2002-05-16 23:28:54 (GMT) |
| commit | 487b06bf45f268ed417aa655fa7b90419f25be2e (patch) | |
| tree | 80433aaa075b0a3419c2d56b60b46c9447fcabbd /src | |
| parent | c4d35e362f544b427d400f4fb1f95da2236976ef (diff) | |
| download | SCons-487b06bf45f268ed417aa655fa7b90419f25be2e.zip SCons-487b06bf45f268ed417aa655fa7b90419f25be2e.tar.gz SCons-487b06bf45f268ed417aa655fa7b90419f25be2e.tar.bz2 | |
Make the drive letters on Windows always be the same case, so that changes in the case of drive letters don't cause a rebuild. (Anthony Roach)
Diffstat (limited to 'src')
| -rw-r--r-- | src/CHANGES.txt | 3 | ||||
| -rw-r--r-- | src/engine/SCons/Node/FS.py | 6 | ||||
| -rw-r--r-- | src/engine/SCons/Util.py | 17 |
3 files changed, 20 insertions, 6 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ad07cf7..a5551aa 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -40,6 +40,9 @@ RELEASE 0.08 - - Fix --implicit-cache when a file has no implicit dependencies and its source is generated. + - Make the drive letters on Windows always be the same case, so that + changes in the case of drive letters don't cause a rebuild. + From Zed Shaw: - Add an Append() method to Environments, to append values to 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, |
