summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-05-16 23:28:54 (GMT)
committerSteven Knight <knight@baldmt.com>2002-05-16 23:28:54 (GMT)
commit487b06bf45f268ed417aa655fa7b90419f25be2e (patch)
tree80433aaa075b0a3419c2d56b60b46c9447fcabbd /src/engine/SCons
parentc4d35e362f544b427d400f4fb1f95da2236976ef (diff)
downloadSCons-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/engine/SCons')
-rw-r--r--src/engine/SCons/Node/FS.py6
-rw-r--r--src/engine/SCons/Util.py17
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,