summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-08-17 07:16:58 (GMT)
committerSteven Knight <knight@baldmt.com>2004-08-17 07:16:58 (GMT)
commit483564c8512e0eaccadb2aebe03e7e928225063b (patch)
tree75da8912f958215a28bc564dac4fcf8f5a3f8bf2 /src/engine
parent3a04ee14eb94ec69fb9b1e0a8ca5bc2e209cf38c (diff)
downloadSCons-483564c8512e0eaccadb2aebe03e7e928225063b.zip
SCons-483564c8512e0eaccadb2aebe03e7e928225063b.tar.gz
SCons-483564c8512e0eaccadb2aebe03e7e928225063b.tar.bz2
Test portability fix. Fix handling of >.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Util.py32
-rw-r--r--src/engine/SCons/UtilTests.py6
2 files changed, 31 insertions, 7 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 25cea2f..ea5d7f6 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -803,16 +803,34 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, di
if not self.in_strip or self.mode != SUBST_SIG:
try:
- y = self[-1][-1] + x
+ current_word = self[-1][-1]
except IndexError:
self.add_new_word(x)
else:
- literal1 = self.literal(self[-1][-1])
- literal2 = self.literal(x)
- y = self.conv(y)
- if is_String(y):
- y = CmdStringHolder(y, literal1 or literal2)
- self[-1][-1] = y
+ # All right, this is a hack and it should probably
+ # be refactored out of existence in the future.
+ # The issue is that we want to smoosh words together
+ # and make one file name that gets escaped if
+ # we're expanding something like foo$EXTENSION,
+ # but we don't want to smoosh them together if
+ # it's something like >$TARGET, because then we'll
+ # treat the '>' like it's part of the file name.
+ # So for now, just hard-code looking for the special
+ # command-line redirection characters...
+ try:
+ last_char = str(current_word)[-1]
+ except IndexError:
+ last_char = '\0'
+ if last_char in '<>|':
+ self.add_new_word(x)
+ else:
+ y = current_word + x
+ literal1 = self.literal(self[-1][-1])
+ literal2 = self.literal(x)
+ y = self.conv(y)
+ if is_String(y):
+ y = CmdStringHolder(y, literal1 or literal2)
+ self[-1][-1] = y
def add_new_word(self, x):
if not self.in_strip or self.mode != SUBST_SIG:
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index fb9f14c..0cda461 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -652,6 +652,12 @@ class UtilTestCase(unittest.TestCase):
# Bug reported by Christoph Wiedemann.
cvt('$xxx/bin'), [['/bin']],
+
+ # Test variables smooshed together with different prefixes.
+ 'foo$AAA', [['fooa']],
+ '<$AAA', [['<', 'a']],
+ '>$AAA', [['>', 'a']],
+ '|$AAA', [['|', 'a']],
]
kwargs = {'target' : target, 'source' : source}