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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 target_os = config_dict.get('target_os', []) | 1214 target_os = config_dict.get('target_os', []) |
1215 if config_dict.get('target_os_only', False): | 1215 if config_dict.get('target_os_only', False): |
1216 self._enforced_os = tuple(set(target_os)) | 1216 self._enforced_os = tuple(set(target_os)) |
1217 else: | 1217 else: |
1218 self._enforced_os = tuple(set(self._enforced_os).union(target_os)) | 1218 self._enforced_os = tuple(set(self._enforced_os).union(target_os)) |
1219 | 1219 |
1220 cache_dir = config_dict.get('cache_dir') | 1220 cache_dir = config_dict.get('cache_dir') |
1221 if cache_dir: | 1221 if cache_dir: |
1222 cache_dir = os.path.join(self.root_dir, cache_dir) | 1222 cache_dir = os.path.join(self.root_dir, cache_dir) |
1223 cache_dir = os.path.abspath(cache_dir) | 1223 cache_dir = os.path.abspath(cache_dir) |
| 1224 # If running on a bot, force break any stale git cache locks. |
| 1225 if os.environ.get('CHROME_HEADLESS'): |
| 1226 subprocess2.check_call(['git', 'cache', 'unlock', '--force', '--all']) |
1224 gclient_scm.GitWrapper.cache_dir = cache_dir | 1227 gclient_scm.GitWrapper.cache_dir = cache_dir |
1225 git_cache.Mirror.SetCachePath(cache_dir) | 1228 git_cache.Mirror.SetCachePath(cache_dir) |
1226 | 1229 |
1227 if not target_os and config_dict.get('target_os_only', False): | 1230 if not target_os and config_dict.get('target_os_only', False): |
1228 raise gclient_utils.Error('Can\'t use target_os_only if target_os is ' | 1231 raise gclient_utils.Error('Can\'t use target_os_only if target_os is ' |
1229 'not specified') | 1232 'not specified') |
1230 | 1233 |
1231 deps_to_add = [] | 1234 deps_to_add = [] |
1232 for s in config_dict.get('solutions', []): | 1235 for s in config_dict.get('solutions', []): |
1233 try: | 1236 try: |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2192 print >> sys.stderr, 'Error: %s' % str(e) | 2195 print >> sys.stderr, 'Error: %s' % str(e) |
2193 return 1 | 2196 return 1 |
2194 finally: | 2197 finally: |
2195 gclient_utils.PrintWarnings() | 2198 gclient_utils.PrintWarnings() |
2196 | 2199 |
2197 | 2200 |
2198 if '__main__' == __name__: | 2201 if '__main__' == __name__: |
2199 sys.exit(Main(sys.argv[1:])) | 2202 sys.exit(Main(sys.argv[1:])) |
2200 | 2203 |
2201 # vim: ts=2:sw=2:tw=80:et: | 2204 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |