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 # Files | 7 # Files |
8 # .gclient : Current client configuration, written by 'config' command. | 8 # .gclient : Current client configuration, written by 'config' command. |
9 # Format is a Python script defining 'solutions', a list whose | 9 # Format is a Python script defining 'solutions', a list whose |
10 # entries each are maps binding the strings "name" and "url" | 10 # entries each are maps binding the strings "name" and "url" |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 except SyntaxError, e: | 1155 except SyntaxError, e: |
1156 gclient_utils.SyntaxErrorToError('.gclient', e) | 1156 gclient_utils.SyntaxErrorToError('.gclient', e) |
1157 | 1157 |
1158 # Append any target OS that is not already being enforced to the tuple. | 1158 # Append any target OS that is not already being enforced to the tuple. |
1159 target_os = config_dict.get('target_os', []) | 1159 target_os = config_dict.get('target_os', []) |
1160 if config_dict.get('target_os_only', False): | 1160 if config_dict.get('target_os_only', False): |
1161 self._enforced_os = tuple(set(target_os)) | 1161 self._enforced_os = tuple(set(target_os)) |
1162 else: | 1162 else: |
1163 self._enforced_os = tuple(set(self._enforced_os).union(target_os)) | 1163 self._enforced_os = tuple(set(self._enforced_os).union(target_os)) |
1164 | 1164 |
1165 gclient_scm.GitWrapper.cache_dir = config_dict.get('cache_dir') | 1165 cache_dir = config_dict.get('cache_dir') |
1166 git_cache.Mirror.SetCachePath(config_dict.get('cache_dir')) | 1166 if cache_dir: |
| 1167 cache_dir = os.path.join(self.root_dir, cache_dir) |
| 1168 cache_dir = os.path.abspath(cache_dir) |
| 1169 gclient_scm.GitWrapper.cache_dir = cache_dir |
| 1170 git_cache.Mirror.SetCachePath(cache_dir) |
1167 | 1171 |
1168 if not target_os and config_dict.get('target_os_only', False): | 1172 if not target_os and config_dict.get('target_os_only', False): |
1169 raise gclient_utils.Error('Can\'t use target_os_only if target_os is ' | 1173 raise gclient_utils.Error('Can\'t use target_os_only if target_os is ' |
1170 'not specified') | 1174 'not specified') |
1171 | 1175 |
1172 deps_to_add = [] | 1176 deps_to_add = [] |
1173 for s in config_dict.get('solutions', []): | 1177 for s in config_dict.get('solutions', []): |
1174 try: | 1178 try: |
1175 deps_to_add.append(Dependency( | 1179 deps_to_add.append(Dependency( |
1176 self, s['name'], s['url'], | 1180 self, s['name'], s['url'], |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2057 print >> sys.stderr, 'Error: %s' % str(e) | 2061 print >> sys.stderr, 'Error: %s' % str(e) |
2058 return 1 | 2062 return 1 |
2059 finally: | 2063 finally: |
2060 gclient_utils.PrintWarnings() | 2064 gclient_utils.PrintWarnings() |
2061 | 2065 |
2062 | 2066 |
2063 if '__main__' == __name__: | 2067 if '__main__' == __name__: |
2064 sys.exit(Main(sys.argv[1:])) | 2068 sys.exit(Main(sys.argv[1:])) |
2065 | 2069 |
2066 # vim: ts=2:sw=2:tw=80:et: | 2070 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |