OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import copy | 5 import copy |
6 import gyp | 6 import gyp |
7 import gyp.common | 7 import gyp.common |
8 import gyp.msvs_emulation | 8 import gyp.msvs_emulation |
9 import gyp.MSVSVersion | 9 import gyp.MSVSVersion |
10 import gyp.system_test | 10 import gyp.system_test |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if arg.startswith(prefix): | 57 if arg.startswith(prefix): |
58 return arg[len(prefix):] | 58 return arg[len(prefix):] |
59 return arg | 59 return arg |
60 | 60 |
61 | 61 |
62 def QuoteShellArgument(arg, flavor): | 62 def QuoteShellArgument(arg, flavor): |
63 """Quote a string such that it will be interpreted as a single argument | 63 """Quote a string such that it will be interpreted as a single argument |
64 by the shell.""" | 64 by the shell.""" |
65 # Rather than attempting to enumerate the bad shell characters, just | 65 # Rather than attempting to enumerate the bad shell characters, just |
66 # whitelist common OK ones and quote anything else. | 66 # whitelist common OK ones and quote anything else. |
67 if re.match(r'^[a-zA-Z0-9_=-]+$', arg): | 67 if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg): |
68 return arg # No quoting necessary. | 68 return arg # No quoting necessary. |
69 if flavor == 'win': | 69 if flavor == 'win': |
70 return gyp.msvs_emulation.QuoteForRspFile(arg) | 70 return gyp.msvs_emulation.QuoteForRspFile(arg) |
71 return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" | 71 return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" |
72 | 72 |
73 | 73 |
74 def InvertRelativePath(path): | 74 def InvertRelativePath(path): |
75 """Given a relative path like foo/bar, return the inverse relative path: | 75 """Given a relative path like foo/bar, return the inverse relative path: |
76 the path from the relative path back to the origin dir. | 76 the path from the relative path back to the origin dir. |
77 | 77 |
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 | 1483 |
1484 user_config = params.get('generator_flags', {}).get('config', None) | 1484 user_config = params.get('generator_flags', {}).get('config', None) |
1485 if user_config: | 1485 if user_config: |
1486 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1486 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1487 user_config) | 1487 user_config) |
1488 else: | 1488 else: |
1489 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1489 config_names = target_dicts[target_list[0]]['configurations'].keys() |
1490 for config_name in config_names: | 1490 for config_name in config_names: |
1491 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1491 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1492 config_name) | 1492 config_name) |
OLD | NEW |