| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 """This module holds utilities which make writing recipes easier.""" | 5 """This module holds utilities which make writing recipes easier.""" |
| 6 | 6 |
| 7 import os as _os | 7 import os as _os |
| 8 | 8 |
| 9 # e.g. /b/build/slave/<slave-name>/build | 9 # e.g. /b/build/slave/<slave-name>/build |
| 10 SLAVE_BUILD_ROOT = _os.path.abspath(_os.getcwd()) | 10 SLAVE_BUILD_ROOT = _os.path.abspath(_os.getcwd()) |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 Note that the 'steps' key will be absent from factory-properties. If you | 178 Note that the 'steps' key will be absent from factory-properties. If you |
| 179 need to pass the list of steps to some of the steps, you will need to do | 179 need to pass the list of steps to some of the steps, you will need to do |
| 180 that manually in your recipe (preferably with json.dumps()). | 180 that manually in your recipe (preferably with json.dumps()). |
| 181 | 181 |
| 182 This placeholder can be automatically added when you use the Steps.step() | 182 This placeholder can be automatically added when you use the Steps.step() |
| 183 method in this module. | 183 method in this module. |
| 184 """ | 184 """ |
| 185 pass | 185 pass |
| 186 PropertyPlaceholder = PropertyPlaceholder() | 186 PropertyPlaceholder = PropertyPlaceholder() |
| 187 | 187 |
| 188 | |
| 189 def _url_method(name): | 188 def _url_method(name): |
| 190 """Returns a shortcut static method which functions like os.path.join and uses | 189 """Returns a shortcut static method which functions like os.path.join and uses |
| 191 a fixed first url component which is chosen from the urls defined in | 190 a fixed first url component which is chosen from the urls defined in |
| 192 SOURCE_URLS based on |name|. | 191 SOURCE_URLS based on |name|. |
| 193 """ | 192 """ |
| 194 # note that we do the __name__ munging for each function separately because | 193 # note that we do the __name__ munging for each function separately because |
| 195 # staticmethod hides these attributes. | 194 # staticmethod hides these attributes. |
| 196 bases = SOURCE_URLS[name] | 195 bases = SOURCE_URLS[name] |
| 197 if len(bases) == 1: | 196 if len(bases) == 1: |
| 198 def url_func_inner_single(*pieces): | 197 def url_func_inner_single(*pieces): |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 '-e', 'commit-bot@chromium.org']) | 255 '-e', 'commit-bot@chromium.org']) |
| 257 | 256 |
| 258 def git_step(self, *args): | 257 def git_step(self, *args): |
| 259 name = 'git '+args[0] | 258 name = 'git '+args[0] |
| 260 # Distinguish 'git config' commands by the variable they are setting. | 259 # Distinguish 'git config' commands by the variable they are setting. |
| 261 if args[0] == 'config' and not args[1].startswith('-'): | 260 if args[0] == 'config' and not args[1].startswith('-'): |
| 262 name += " "+args[1] | 261 name += " "+args[1] |
| 263 return self.step(name, [ | 262 return self.step(name, [ |
| 264 'git', '--work-tree', checkout_path(), | 263 'git', '--work-tree', checkout_path(), |
| 265 '--git-dir', checkout_path('.git')]+list(args)) | 264 '--git-dir', checkout_path('.git')]+list(args)) |
| OLD | NEW |