diff options
author | Jason Haslam <jason@scitools.com> | 2015-06-22 22:28:04 (GMT) |
---|---|---|
committer | Jason Haslam <jason@scitools.com> | 2015-06-22 22:28:04 (GMT) |
commit | 5d4473d548ec839ee2c5acc006db682afad0bd15 (patch) | |
tree | defa56c7ea976b18da5181aa7daa00725541376f /configure.py | |
parent | d3441a03386e0d1766c1a4b79d5fa5098786860f (diff) | |
download | Ninja-5d4473d548ec839ee2c5acc006db682afad0bd15.zip Ninja-5d4473d548ec839ee2c5acc006db682afad0bd15.tar.gz Ninja-5d4473d548ec839ee2c5acc006db682afad0bd15.tar.bz2 |
Fix bootstrap from a source path containing spaces.
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/configure.py b/configure.py index 27516b4..7413659 100755 --- a/configure.py +++ b/configure.py @@ -156,12 +156,16 @@ class Bootstrap: def _expand_paths(self, paths): """Expand $vars in an array of paths, e.g. from a 'build' block.""" paths = ninja_syntax.as_list(paths) - return ' '.join(map(self._expand, paths)) + return ' '.join(map(self._shell_escape, (map(self._expand, paths)))) def _expand(self, str, local_vars={}): """Expand $vars in a string.""" return ninja_syntax.expand(str, self.vars, local_vars) + def _shell_escape(self, path): + """Quote paths containing spaces.""" + return '"%s"' % path if ' ' in path else path + def _run_command(self, cmdline): """Run a subcommand, quietly. Prints the full command on error.""" try: @@ -420,7 +424,7 @@ objs = [] if platform.supports_ninja_browse(): n.comment('browse_py.h is used to inline browse.py.') n.rule('inline', - command=src('inline.sh') + ' $varname < $in > $out', + command='"%s"' % src('inline.sh') + ' $varname < $in > $out', description='INLINE $out') n.build(built('browse_py.h'), 'inline', src('browse.py'), implicit=src('inline.sh'), |