OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. 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 from recipe_engine import recipe_api | 5 from recipe_engine import recipe_api |
6 | 6 |
7 | 7 |
8 class RevisionResolver(object): | 8 class RevisionResolver(object): |
9 """Resolves the revision based on build properties.""" | 9 """Resolves the revision based on build properties.""" |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 def __call__(self, name, cmd, infra_step=True, **kwargs): | 86 def __call__(self, name, cmd, infra_step=True, **kwargs): |
87 """Wrapper for easy calling of gclient steps.""" | 87 """Wrapper for easy calling of gclient steps.""" |
88 assert isinstance(cmd, (list, tuple)) | 88 assert isinstance(cmd, (list, tuple)) |
89 prefix = 'gclient ' | 89 prefix = 'gclient ' |
90 if self.spec_alias: | 90 if self.spec_alias: |
91 prefix = ('[spec: %s] ' % self.spec_alias) + prefix | 91 prefix = ('[spec: %s] ' % self.spec_alias) + prefix |
92 | 92 |
93 kwargs.setdefault('env', {}) | 93 kwargs.setdefault('env', {}) |
94 kwargs['env'].setdefault('PATH', '%(PATH)s') | 94 kwargs['env'].setdefault('PATH', '%(PATH)s') |
95 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | 95 kwargs['env']['PATH'] = self.m.path.pathsep.join([ |
96 kwargs['env']['PATH'], str(self._module.PACKAGE_DIRECTORY)]) | 96 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) |
97 | 97 |
98 return self.m.python(prefix + name, | 98 return self.m.python(prefix + name, |
99 self.package_resource('gclient.py'), | 99 self.package_repo_resource('gclient.py'), |
100 cmd, | 100 cmd, |
101 infra_step=infra_step, | 101 infra_step=infra_step, |
102 **kwargs) | 102 **kwargs) |
103 | 103 |
104 @property | 104 @property |
105 def use_mirror(self): | 105 def use_mirror(self): |
106 """Indicates if gclient will use mirrors in its configuration.""" | 106 """Indicates if gclient will use mirrors in its configuration.""" |
107 if self.USE_MIRROR is None: | 107 if self.USE_MIRROR is None: |
108 self.USE_MIRROR = self.m.properties.get('use_mirror', True) | 108 self.USE_MIRROR = self.m.properties.get('use_mirror', True) |
109 return self.USE_MIRROR | 109 return self.USE_MIRROR |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 for (path, dir, files) in os.walk(build_path): | 321 for (path, dir, files) in os.walk(build_path): |
322 for cur_file in files: | 322 for cur_file in files: |
323 if cur_file.endswith('index.lock'): | 323 if cur_file.endswith('index.lock'): |
324 path_to_file = os.path.join(path, cur_file) | 324 path_to_file = os.path.join(path, cur_file) |
325 print 'deleting %s' % path_to_file | 325 print 'deleting %s' % path_to_file |
326 os.remove(path_to_file) | 326 os.remove(path_to_file) |
327 """, | 327 """, |
328 args=[self.m.path['slave_build']], | 328 args=[self.m.path['slave_build']], |
329 infra_step=True, | 329 infra_step=True, |
330 ) | 330 ) |
OLD | NEW |