summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt8
-rw-r--r--src/engine/SCons/Platform/win32.py13
-rw-r--r--src/engine/SCons/Tool/CVS.py8
-rw-r--r--src/engine/SCons/Util.py9
-rw-r--r--src/engine/SCons/UtilTests.py7
5 files changed, 41 insertions, 4 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index a036568..c48b40d 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -14,6 +14,14 @@ RELEASE 0.14 - XXX
- Add support for Java (javac and jar).
+ - Propagate the external SYSTEMROOT environment variable into ENV on
+ Win32 systems, so external commands that use sockets will work.
+
+ - Add a .posix attribute to PathList expansions.
+
+ - Check out CVS source files using POSIX path names (forward slashes
+ as separators) even on Win32.
+
RELEASE 0.13 - Mon, 31 Mar 2003 20:22:00 -0600
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py
index 870dd99..3591ac6 100644
--- a/src/engine/SCons/Platform/win32.py
+++ b/src/engine/SCons/Platform/win32.py
@@ -118,6 +118,19 @@ def generate(env):
if not env.has_key('ENV'):
env['ENV'] = {}
+
+ # Import things from the external environment to the construction
+ # environment's ENV. This is a potential slippery slope, because we
+ # *don't* want to make builds dependent on the user's environment by
+ # default. We're doing this for SYSTEMROOT, though, because it's
+ # needed for anything that uses sockets, and seldom changes. Weigh
+ # the impact carefully before adding other variables to this list.
+ import_env = [ 'SYSTEMROOT' ]
+ for var in import_env:
+ v = os.environ.get(var)
+ if v:
+ env['ENV'][var] = v
+
env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD'
env['OBJPREFIX'] = ''
env['OBJSUFFIX'] = '.obj'
diff --git a/src/engine/SCons/Tool/CVS.py b/src/engine/SCons/Tool/CVS.py
index b8f6968..9c5dc60 100644
--- a/src/engine/SCons/Tool/CVS.py
+++ b/src/engine/SCons/Tool/CVS.py
@@ -45,8 +45,10 @@ def generate(env, platform):
""" """
# fail if repos is not an absolute path name?
if module != '':
- module = os.path.join(module, '')
- env['CVSCOM'] = '$CVS $CVSFLAGS co $CVSCOFLAGS -p $CVSMODULE$TARGET > $TARGET'
+ # Don't use os.path.join() because the name we fetch might
+ # be across a network and must use POSIX slashes as separators.
+ module = module + '/'
+ env['CVSCOM'] = '$CVS $CVSFLAGS co $CVSCOFLAGS -p $CVSMODULE${TARGET.posix} > $TARGET'
return SCons.Builder.Builder(action = '$CVSCOM',
env = env,
overrides = {'CVSREPOSITORY':repos,
@@ -57,7 +59,7 @@ def generate(env, platform):
env['CVS'] = 'cvs'
env['CVSFLAGS'] = '-d $CVSREPOSITORY'
env['CVSCOFLAGS'] = ''
- env['CVSCOM'] = '$CVS $CVSFLAGS co $CVSCOFLAGS $TARGET'
+ env['CVSCOM'] = '$CVS $CVSFLAGS co $CVSCOFLAGS ${TARGET.posix}'
def exists(env):
return env.Detect('cvs')
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 3bfb79a..b1a8679 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -166,12 +166,19 @@ class PathList(UserList.UserList):
# available even if this object is a Lister, not a PathList.
return PathList(map(lambda x: updrive(os.path.abspath(x)), self.data))
+ def __posix(self):
+ if os.sep == '/':
+ return self
+ else:
+ return PathList(map(lambda x: string.replace(x, os.sep, '/'), self.data))
+
dictSpecialAttrs = { "file" : __getFileName,
"base" : __getBasePath,
"filebase" : __getBase,
"dir" : __getDir,
"suffix" : __getSuffix,
- "abspath" : __getAbsPath}
+ "abspath" : __getAbsPath,
+ "posix" : __posix}
def is_literal(self):
return 1
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index 890f54d..a176013 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -156,6 +156,13 @@ class UtilTestCase(unittest.TestCase):
target=target, source=source)
assert newcom == cvt("test %s/foo/blah.cpp"%SCons.Util.updrive(os.getcwd())), newcom
+ # Note that we don't use the cvt() helper function here,
+ # because we're testing that the .posix attribute does its own
+ # conversion of the path name backslashes to slashes.
+ newcom = scons_subst("test ${TARGET.posix} ${SOURCE.posix}", env,
+ target=target, source=source)
+ assert newcom == "test foo/bar.exe foo/blah.cpp", newcom
+
newcom = scons_subst("test $xxx", env)
assert newcom == cvt("test"), newcom