summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-11-13 08:49:30 (GMT)
committerSteven Knight <knight@baldmt.com>2002-11-13 08:49:30 (GMT)
commit3cd1df2a2faa246a150f9a6e5a29368eab106a30 (patch)
tree6923adde0391471bd033183fa8f34ae38edcb4ed
parentc3f2f406542da875245f96d9505b5bedde0a5de0 (diff)
downloadSCons-3cd1df2a2faa246a150f9a6e5a29368eab106a30.zip
SCons-3cd1df2a2faa246a150f9a6e5a29368eab106a30.tar.gz
SCons-3cd1df2a2faa246a150f9a6e5a29368eab106a30.tar.bz2
Win32 portability.
-rw-r--r--SConstruct5
-rw-r--r--runtest.py2
-rw-r--r--src/engine/SCons/Action.py2
-rw-r--r--src/engine/SCons/Util.py12
-rw-r--r--test/ParseConfig.py8
-rw-r--r--test/special-filenames.py2
6 files changed, 21 insertions, 10 deletions
diff --git a/SConstruct b/SConstruct
index 143f1a6..866da6b 100644
--- a/SConstruct
+++ b/SConstruct
@@ -725,7 +725,8 @@ for p in [ scons ]:
# And, lastly, install the appropriate packages in the
# appropriate subdirectory.
#
- env.Install(os.path.join('build', 'dist'), install_targets)
+ b_d_files = env.Install(os.path.join('build', 'dist'), install_targets)
+ Local(b_d_files)
#
#
@@ -779,6 +780,8 @@ if change:
src_tar_gz = os.path.join('build', 'dist', '%s.tar.gz' % psv)
src_zip = os.path.join('build', 'dist', '%s.zip' % psv)
+ Local(src_tar_gz, src_zip)
+
for file in sfiles:
env.SCons_revision(os.path.join(b_ps, file), file)
diff --git a/runtest.py b/runtest.py
index 158d5b6..ebaf758 100644
--- a/runtest.py
+++ b/runtest.py
@@ -312,7 +312,7 @@ if len(tests) != 1:
sys.stdout.write("\nFailed the following test:\n")
else:
sys.stdout.write("\nFailed the following %d tests:\n" % len(fail))
- paths = map(lambda x: x.path, no_result)
+ paths = map(lambda x: x.path, fail)
sys.stdout.write("\t" + string.join(paths, "\n\t") + "\n")
if no_result:
if len(no_result) == 1:
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index 255f329..8347195 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -175,7 +175,7 @@ elif os.name == 'nt':
return 127
else:
try:
- args = [cmd_interp, '/C', quote(string.join(args)) ]
+ args = [cmd_interp, '/C', escape_cmd(string.join(args)) ]
ret = os.spawnve(os.P_WAIT, cmd_interp, args, env)
except OSError, e:
ret = exitvalmap[e[0]]
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index adba42a..62772ae 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -204,7 +204,7 @@ def quote_spaces(arg):
if ' ' in arg or '\t' in arg:
return '"%s"' % arg
else:
- return arg
+ return str(arg)
# Several functions below deal with Environment variable
# substitution. Part of this process involves inserting
@@ -290,7 +290,7 @@ class CmdStringHolder:
in the string before passing it to the command interpreter."""
self.data = cmd
- # Populate flatdata (the ting returned by str()) with the
+ # Populate flatdata (the thing returned by str()) with the
# non-escaped string
self.escape(lambda x: x, lambda x: x)
@@ -298,6 +298,14 @@ class CmdStringHolder:
"""Return the string in its current state."""
return self.flatdata
+ def __len__(self):
+ """Return the length of the string in its current state."""
+ return len(self.flatdata)
+
+ def __getitem__(self, index):
+ """Return the index'th element of the string in its current state."""
+ return self.flatdata[index]
+
def escape(self, escape_func, quote_func=quote_spaces):
"""Escape the string with the supplied function. The
function is expected to take an arbitrary string, then
diff --git a/test/ParseConfig.py b/test/ParseConfig.py
index 1cf52ed..eaf7802 100644
--- a/test/ParseConfig.py
+++ b/test/ParseConfig.py
@@ -39,8 +39,8 @@ print "-L/usr/fax -Lfoo -lxxx abc"
""")
test.write('SConstruct', """
-env = Environment()
-static_libs = ParseConfig(env, ["%s", "%s", "--libs --cflags"])
+env = Environment(CPPPATH = [], LIBPATH = [], LIBS = [], CCFLAGS = '')
+static_libs = ParseConfig(env, [r"%s", r"%s", "--libs --cflags"])
print env['CPPPATH']
print env['LIBPATH']
print env['LIBS']
@@ -49,8 +49,8 @@ print static_libs
""" % (sys.executable, test_config))
test.write('SConstruct2', """
-env = Environment()
-static_libs = ParseConfig(env, "%s %s --libs --cflags")
+env = Environment(CPPPATH = [], LIBPATH = [], LIBS = [], CCFLAGS = '')
+static_libs = ParseConfig(env, r"%s %s --libs --cflags")
print env['CPPPATH']
print env['LIBPATH']
print env['LIBS']
diff --git a/test/special-filenames.py b/test/special-filenames.py
index 88db6bb..3f05fe3 100644
--- a/test/special-filenames.py
+++ b/test/special-filenames.py
@@ -55,7 +55,7 @@ if os.name == 'nt':
test.write("cat.py", """\
import sys
-open(sys.argv[1], 'w').write(open(sys.argv[2], 'r').read())
+open(sys.argv[1], 'wb').write(open(sys.argv[2], 'rb').read())
""")
for fn in file_names: