summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-08-20 12:44:02 (GMT)
committerSteven Knight <knight@baldmt.com>2005-08-20 12:44:02 (GMT)
commitcfcbeb6ff0607e5a573768eb1dbaef6fe86089a2 (patch)
treee8e031b63ffbd10f59613892e5ee10c08e223ffe
parent363f4dd969747edcc783584138a8daf018417a47 (diff)
downloadSCons-cfcbeb6ff0607e5a573768eb1dbaef6fe86089a2.zip
SCons-cfcbeb6ff0607e5a573768eb1dbaef6fe86089a2.tar.gz
SCons-cfcbeb6ff0607e5a573768eb1dbaef6fe86089a2.tar.bz2
Handle files with white space when in temporary files. (Stanislav Baranov)
-rw-r--r--src/engine/SCons/Util.py5
-rw-r--r--src/engine/SCons/UtilTests.py6
2 files changed, 10 insertions, 1 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index a4516e9..084975a 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -546,11 +546,12 @@ _regex_remove = [ _rm, None, _remove ]
#
# " " [white space]
# "non-white-space" [without any dollar signs]
+# '"with-space-or-not"' [without any dollar signs]
# "$" [single dollar sign]
#
_dollar_exps_str = r'\$[\$\(\)]|\$[_a-zA-Z][\.\w]*|\${[^}]*}'
_dollar_exps = re.compile(r'(%s)' % _dollar_exps_str)
-_separate_args = re.compile(r'(%s|\s+|[^\s\$]+|\$)' % _dollar_exps_str)
+_separate_args = re.compile(r'(%s|\s+|[^"\s\$]+|"[^"\$]+"|\$)' % _dollar_exps_str)
# This regular expression is used to replace strings of multiple white
# space characters in the string result from the scons_subst() function.
@@ -890,6 +891,8 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gv
else:
self.next_word()
else:
+ if a[0] == '"' and a[-1] == '"':
+ a = a[1:-1]
self.expand(a, lvars, within_list)
else:
self.expand(args, lvars, within_list)
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index 6236038..ce9fd56 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -325,6 +325,9 @@ class UtilTestCase(unittest.TestCase):
# Tests callables that don't match our calling arguments.
'$CALLABLE', 'callable-1',
+
+ # Test handling of quotes.
+ 'aaa "bbb ccc" ddd', 'aaa "bbb ccc" ddd',
]
kwargs = {'target' : target, 'source' : source,
@@ -717,6 +720,9 @@ class UtilTestCase(unittest.TestCase):
# Test callables that don't match our calling arguments.
'$CALLABLE', [['callable-2']],
+
+ # Test handling of quotes.
+ 'aaa "bbb ccc" ddd', [['aaa', 'bbb ccc', 'ddd']],
]
gvars = env.Dictionary()