From 91de99a737519c50047845cfd0c810b6d9329cc6 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Tue, 24 Mar 2015 23:02:41 -0400 Subject: [PATCH] SERVER-17730 Allow selection of non-posix shlex mode for Variables --- SConstruct | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index a45d23675e0..ffb76f42e2b 100644 --- a/SConstruct +++ b/SConstruct @@ -333,9 +333,19 @@ add_option('cache-dir', "Specify the directory to use for caching objects if --cache is in use", 1, False, default="$BUILD_ROOT/scons/cache") +variable_parse_mode_choices=['auto', 'posix', 'other'] +add_option('variable-parse-mode', + "Select which parsing mode is used to interpret command line variables", + 1, False, + type='choice', default=variable_parse_mode_choices[0], + choices=variable_parse_mode_choices) + # Setup the command-line variables def variable_shlex_converter(val): - return shlex.split(val) + parse_mode = get_option('variable-parse-mode') + if parse_mode == 'auto': + parse_mode = 'other' if windows else 'posix' + return shlex.split(val, posix=(parse_mode == 'posix')) def variable_arch_converter(val): arches = {