Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: pylib/gyp/msvs_emulation.py

Issue 10340002: Don't support spaces in command, simplify msvs_emulation (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: explicitly don't support spaces in command name, simplify msvs_emulation Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/win/gyptest-command-quote.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/msvs_emulation.py
diff --git a/pylib/gyp/msvs_emulation.py b/pylib/gyp/msvs_emulation.py
index 72e09eefa916dc880e41ac8a214c52d095eb3de6..3eb1e6c0773a4e39fa9f140e021b8fce787db545 100644
--- a/pylib/gyp/msvs_emulation.py
+++ b/pylib/gyp/msvs_emulation.py
@@ -53,20 +53,13 @@ def QuoteForRspFile(arg):
def EncodeRspFileList(args):
"""Process a list of arguments using QuoteCmdExeArgument."""
- # Note that the first argument is assumed to be the command. We take extra
- # steps to make sure that calls to .bat files are handled correctly, and
- # that paths are normalized and quoted as necessary.
+ # Note that the first argument is assumed to be the command. Don't add
+ # quotes around it because then commands like 'call x.bat' or shell
+ # built-ins like 'echo', etc. won't work. Also, don't bother special casing
+ # to get quotes around the remainder (after 'call') since other generators
+ # and gyp in general don't really support spaces in paths.
if not args: return ''
program = args[0]
- if program.startswith('call '):
- call, batch = program.split(' ', 1)
- program = 'call ' + QuoteForRspFile(os.path.normpath(batch))
- else:
- program = os.path.normpath(program)
- # Don't add quotes around things without spaces so that 'call', 'echo',
- # etc. will work if they're specified as individual arguments.
- if ' ' in program:
- program = QuoteForRspFile(program)
return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:])
« no previous file with comments | « no previous file | test/win/gyptest-command-quote.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698