Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Meta checkout manager supporting both Subversion and GIT. | 6 """Meta checkout manager supporting both Subversion and GIT. |
| 7 | 7 |
| 8 Files | 8 Files |
| 9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
| 10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 "action": ["python", "image_indexer.py", "--all"]}, | 48 "action": ["python", "image_indexer.py", "--all"]}, |
| 49 ] | 49 ] |
| 50 | 50 |
| 51 Specifying a target OS | 51 Specifying a target OS |
| 52 An optional key named "target_os" may be added to a gclient file to specify | 52 An optional key named "target_os" may be added to a gclient file to specify |
| 53 one or more additional operating systems that should be considered when | 53 one or more additional operating systems that should be considered when |
| 54 processing the deps_os dict of a DEPS file. | 54 processing the deps_os dict of a DEPS file. |
| 55 | 55 |
| 56 Example: | 56 Example: |
| 57 target_os = [ "android" ] | 57 target_os = [ "android" ] |
| 58 | |
| 59 If the "target_os_only" key is also present and true, then *only* the | |
| 60 operating systems listed in target_os will be used. | |
| 61 | |
| 62 Example: | |
| 63 target_os = [ "ios" ] | |
| 64 target_os_only = True | |
| 58 """ | 65 """ |
| 59 | 66 |
| 60 __version__ = "0.6.4" | 67 __version__ = "0.6.4" |
| 61 | 68 |
| 62 import copy | 69 import copy |
| 63 import logging | 70 import logging |
| 64 import optparse | 71 import optparse |
| 65 import os | 72 import os |
| 66 import platform | 73 import platform |
| 67 import posixpath | 74 import posixpath |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 879 assert not self.dependencies | 886 assert not self.dependencies |
| 880 config_dict = {} | 887 config_dict = {} |
| 881 self.config_content = content | 888 self.config_content = content |
| 882 try: | 889 try: |
| 883 exec(content, config_dict) | 890 exec(content, config_dict) |
| 884 except SyntaxError, e: | 891 except SyntaxError, e: |
| 885 gclient_utils.SyntaxErrorToError('.gclient', e) | 892 gclient_utils.SyntaxErrorToError('.gclient', e) |
| 886 | 893 |
| 887 # Append any target OS that is not already being enforced to the tuple. | 894 # Append any target OS that is not already being enforced to the tuple. |
| 888 target_os = config_dict.get('target_os', []) | 895 target_os = config_dict.get('target_os', []) |
| 889 self._enforced_os = tuple(set(self._enforced_os).union(target_os)) | 896 if config_dict.get('target_os_only', False): |
|
M-A Ruel
2012/11/01 18:35:49
Should it work if 'target_os' is not present?
stuartmorgan
2012/11/02 05:50:02
I figured that would fall under "just don't do tha
| |
| 897 self._enforced_os = tuple(set(target_os)) | |
| 898 else: | |
| 899 self._enforced_os = tuple(set(self._enforced_os).union(target_os)) | |
| 890 | 900 |
| 891 deps_to_add = [] | 901 deps_to_add = [] |
| 892 for s in config_dict.get('solutions', []): | 902 for s in config_dict.get('solutions', []): |
| 893 try: | 903 try: |
| 894 deps_to_add.append(Dependency( | 904 deps_to_add.append(Dependency( |
| 895 self, s['name'], s['url'], | 905 self, s['name'], s['url'], |
| 896 s.get('safesync_url', None), | 906 s.get('safesync_url', None), |
| 897 s.get('managed', True), | 907 s.get('managed', True), |
| 898 s.get('custom_deps', {}), | 908 s.get('custom_deps', {}), |
| 899 s.get('custom_vars', {}), | 909 s.get('custom_vars', {}), |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1659 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1669 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1660 print >> sys.stderr, 'Error: %s' % str(e) | 1670 print >> sys.stderr, 'Error: %s' % str(e) |
| 1661 return 1 | 1671 return 1 |
| 1662 | 1672 |
| 1663 | 1673 |
| 1664 if '__main__' == __name__: | 1674 if '__main__' == __name__: |
| 1665 fix_encoding.fix_encoding() | 1675 fix_encoding.fix_encoding() |
| 1666 sys.exit(Main(sys.argv[1:])) | 1676 sys.exit(Main(sys.argv[1:])) |
| 1667 | 1677 |
| 1668 # vim: ts=2:sw=2:tw=80:et: | 1678 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |