From: stevenknight Date: Wed, 12 Nov 2008 00:12:33 +0000 (+0000) Subject: Merged revisions 3225-3226 via svnmerge from X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fe065df4f2118cb9a1b8192c48247bd919dabb4a;p=scons.git Merged revisions 3225-3226 via svnmerge from http://scons.tigris.org/svn/scons/branches/sgk_subst ........ r3225 | stevenknight | 2008-07-18 10:46:49 -0700 (Fri, 18 Jul 2008) | 3 lines Remove an unnecessary \n from the end of the $INSTALLSTR setting (unneeded because string substituion currently strips trailing white space). ........ r3226 | stevenknight | 2008-07-19 07:17:10 -0700 (Sat, 19 Jul 2008) | 3 lines Use subst_list() for generating ToolSurrogate *COMSTR values so we don't rely on the current white-space compression behavior of subst(). ........ git-svn-id: http://scons.tigris.org/svn/scons/trunk@3781 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/bin/sconsexamples.py b/bin/sconsexamples.py index 5fbdc419..ac8dce3a 100644 --- a/bin/sconsexamples.py +++ b/bin/sconsexamples.py @@ -156,6 +156,7 @@ Prompt = { # command output. Stdin = """\ +import string import SCons.Defaults platform = '%s' @@ -176,7 +177,10 @@ class Curry: return apply(self.fun, self.pending + args, kw) def Str(target, source, env, cmd=""): - return env.subst(cmd, target=target, source=source) + result = [] + for cmd in env.subst_list(cmd, target=target, source=source): + result.append(string.join(map(str, cmd))) + return string.join(result, '\\n') class ToolSurrogate: def __init__(self, tool, variable, func): diff --git a/bin/sconsoutput.py b/bin/sconsoutput.py index 536bcea3..ecc816ce 100644 --- a/bin/sconsoutput.py +++ b/bin/sconsoutput.py @@ -238,7 +238,10 @@ class Curry: return apply(self.fun, self.pending + args, kw) def Str(target, source, env, cmd=""): - return env.subst(cmd, target=target, source=source) + result = [] + for cmd in env.subst_list(cmd, target=target, source=source): + result.append(string.join(map(str, cmd))) + return string.join(result, '\\n') class ToolSurrogate: def __init__(self, tool, variable, func, varlist): diff --git a/test/Install/INSTALLSTR.py b/test/Install/INSTALLSTR.py index d809b2ce..0b515581 100644 --- a/test/Install/INSTALLSTR.py +++ b/test/Install/INSTALLSTR.py @@ -37,7 +37,7 @@ test = TestSCons.TestSCons() test.subdir('install') test.write('SConstruct', """\ -env = Environment(INSTALLSTR = 'INSTALL $SOURCE => $TARGET!\\n') +env = Environment(INSTALLSTR = 'INSTALL $SOURCE => $TARGET!') env.Install('install', 'file') """) diff --git a/test/ToolSurrogate.py b/test/ToolSurrogate.py index 5db156ea..dd5ea06b 100644 --- a/test/ToolSurrogate.py +++ b/test/ToolSurrogate.py @@ -34,6 +34,7 @@ import TestSCons test = TestSCons.TestSCons() test.write('SConstruct', """\ +import string class Curry: def __init__(self, fun, *args, **kwargs): self.fun = fun @@ -50,7 +51,10 @@ class Curry: return apply(self.fun, self.pending + args, kw) def Str(target, source, env, cmd=""): - return env.subst(cmd, target=target, source=source) + result = [] + for cmd in env.subst_list(cmd, target=target, source=source): + result.append(string.join(map(str, cmd))) + return string.join(result, '\\n') class ToolSurrogate: def __init__(self, tool, variable, func):