diff options
author | Steven Knight <knight@baldmt.com> | 2005-11-05 23:14:01 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-11-05 23:14:01 (GMT) |
commit | 4c56e48d6acf33240d467b9baf97726eb4e243f3 (patch) | |
tree | c825ed399d115dfa1db3e530dcb4aa1375609c84 | |
parent | 9dd50b05906e8a2efeb877ad979037f836a7d347 (diff) | |
download | SCons-4c56e48d6acf33240d467b9baf97726eb4e243f3.zip SCons-4c56e48d6acf33240d467b9baf97726eb4e243f3.tar.gz SCons-4c56e48d6acf33240d467b9baf97726eb4e243f3.tar.bz2 |
Fix a bug in command-line escaping. (Jan Nieuwenhuizen)
-rw-r--r-- | src/CHANGES.txt | 11 | ||||
-rw-r--r-- | src/engine/SCons/Subst.py | 16 | ||||
-rw-r--r-- | src/engine/SCons/SubstTests.py | 19 |
3 files changed, 41 insertions, 5 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 38a0476..f65e061 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -449,6 +449,10 @@ RELEASE 0.97 - XXX value directory; avoiding slowing substitution logic when there's no '$' in the string. + From Jan Nieuwenhuizen: + + - Fix a problem with interpreting quoted argument lists on command lines. + From Greg Noel: - Add construction variables to support frameworks on Mac OS X: @@ -706,6 +710,13 @@ RELEASE 0.97 - XXX - Update EnsureSConsVersion() to support revision numbers. + From Dobes Vandermeer: + + - Add support for SCC and other settings in Microsoft Visual + Studio project and solution files: $MSVS_PROJECT_BASE_PATH, + $MSVS_PROJECT_GUID, $MSVS_SCC_AUX_PATH, $MSVS_SCC_LOCAL_PATH, + $MSVS_SCC_PROJECT_NAME, $MSVS_SCC_PROVIDER, + From Greg Ward: - Fix a misplaced line in the man page. diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 4767403..56522a1 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -708,11 +708,21 @@ def scons_subst_list(strSubst, env, mode=SUBST_RAW, target=None, source=None, gv self.add_new_word(x) else: y = current_word + x - literal1 = self.literal(self[-1][-1]) - literal2 = self.literal(x) + + # We used to treat a word appended to a literal + # as a literal itself, but this caused problems + # with interpreting quotes around space-separated + # targets on command lines. Removing this makes + # none of the "substantive" end-to-end tests fail, + # so we'll take this out but leave it commented + # for now in case there's a problem not covered + # by the test cases and we need to resurrect this. + #literal1 = self.literal(self[-1][-1]) + #literal2 = self.literal(x) y = self.conv(y) if is_String(y): - y = CmdStringHolder(y, literal1 or literal2) + #y = CmdStringHolder(y, literal1 or literal2) + y = CmdStringHolder(y, None) self[-1][-1] = y def add_new_word(self, x): diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py index 64a2fe5..8a56f67 100644 --- a/src/engine/SCons/SubstTests.py +++ b/src/engine/SCons/SubstTests.py @@ -818,11 +818,26 @@ class SubstTestCase(unittest.TestCase): c = cmd_list[0][3].escape(escape_func) assert c == 'xyz', c + # We used to treat literals smooshed together like the whole + # thing was literal and escape it as a unit. The commented-out + # asserts below are in case we ever have to find a way to + # resurrect that functionality in some way. cmd_list = scons_subst_list("abc${LITERALS}xyz", env, gvars=gvars) c = cmd_list[0][0].escape(escape_func) - assert c == '**abcfoo\nwith\nnewlines**', c + #assert c == '**abcfoo\nwith\nnewlines**', c + assert c == 'abcfoo\nwith\nnewlines', c c = cmd_list[0][1].escape(escape_func) - assert c == '**bar\nwith\nnewlinesxyz**', c + #assert c == '**bar\nwith\nnewlinesxyz**', c + assert c == 'bar\nwith\nnewlinesxyz', c + + cmd_list = scons_subst_list('echo "target: $TARGET"', env, + target=_t, gvars=gvars) + c = cmd_list[0][0].escape(escape_func) + assert c == 'echo', c + c = cmd_list[0][1].escape(escape_func) + assert c == '"target:', c + c = cmd_list[0][2].escape(escape_func) + assert c == 't"', c # Tests of the various SUBST_* modes of substitution. subst_list_cases = [ |