equal
deleted
inserted
replaced
157 #print "get_run_program_argv(program_string=%r, command_template=%r)" % (program_string, command_template) |
157 #print "get_run_program_argv(program_string=%r, command_template=%r)" % (program_string, command_template) |
158 env = bld.env |
158 env = bld.env |
159 |
159 |
160 if command_template in (None, '%s'): |
160 if command_template in (None, '%s'): |
161 argv = shlex.split(program_string) |
161 argv = shlex.split(program_string) |
|
162 #print "%r ==shlex.split==> %r" % (program_string, argv) |
162 program_name = argv[0] |
163 program_name = argv[0] |
163 |
164 |
164 try: |
165 try: |
165 program_obj = find_program(program_name, env) |
166 program_obj = find_program(program_name, env) |
166 except ValueError, ex: |
167 except ValueError, ex: |
186 #try: |
187 #try: |
187 # program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj)) |
188 # program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj)) |
188 #except AttributeError: |
189 #except AttributeError: |
189 # raise Utils.WafError("%s does not appear to be a program" % (program_name,)) |
190 # raise Utils.WafError("%s does not appear to be a program" % (program_name,)) |
190 |
191 |
191 execvec = shlex.split(command_template % (program_node.abspath(env),)) |
192 tmpl = command_template % (program_node.abspath(env),) |
|
193 execvec = shlex.split(tmpl.replace('\\', '\\\\')) |
|
194 #print "%r ==shlex.split==> %r" % (command_template % (program_node.abspath(env),), execvec) |
192 return program_name, execvec |
195 return program_name, execvec |
193 |
196 |
194 def run_program(program_string, env, command_template=None, cwd=None): |
197 def run_program(program_string, env, command_template=None, cwd=None): |
195 """ |
198 """ |
196 if command_template is not None, then program_string == program |
199 if command_template is not None, then program_string == program |