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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 self.USE_MIRROR = None | 83 self.USE_MIRROR = None |
84 self._spec_alias = None | 84 self._spec_alias = None |
85 | 85 |
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', {}) | |
94 kwargs['env'].setdefault('PATH', '%(PATH)s') | |
Michael Achenbach
2016/02/05 11:56:41
Is there a % operator applied on the value later?
| |
95 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | |
96 kwargs['env']['PATH'], str(self._module.PACKAGE_DIRECTORY)]) | |
Michael Achenbach
2016/02/05 11:56:41
Do you want it in the end? What if there is anothe
| |
97 | |
93 return self.m.python(prefix + name, | 98 return self.m.python(prefix + name, |
94 self.package_resource('gclient.py'), | 99 self.package_resource('gclient.py'), |
95 cmd, | 100 cmd, |
96 infra_step=infra_step, | 101 infra_step=infra_step, |
97 **kwargs) | 102 **kwargs) |
98 | 103 |
99 @property | 104 @property |
100 def use_mirror(self): | 105 def use_mirror(self): |
101 """Indicates if gclient will use mirrors in its configuration.""" | 106 """Indicates if gclient will use mirrors in its configuration.""" |
102 if self.USE_MIRROR is None: | 107 if self.USE_MIRROR is None: |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 for (path, dir, files) in os.walk(build_path): | 322 for (path, dir, files) in os.walk(build_path): |
318 for cur_file in files: | 323 for cur_file in files: |
319 if cur_file.endswith('index.lock'): | 324 if cur_file.endswith('index.lock'): |
320 path_to_file = os.path.join(path, cur_file) | 325 path_to_file = os.path.join(path, cur_file) |
321 print 'deleting %s' % path_to_file | 326 print 'deleting %s' % path_to_file |
322 os.remove(path_to_file) | 327 os.remove(path_to_file) |
323 """, | 328 """, |
324 args=[self.m.path['slave_build']], | 329 args=[self.m.path['slave_build']], |
325 infra_step=True, | 330 infra_step=True, |
326 ) | 331 ) |
OLD | NEW |