Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Utility functions used by the bisect tool. | 5 """Utility functions used by the bisect tool. |
| 6 | 6 |
| 7 This includes functions related to checking out the depot and outputting | 7 This includes functions related to checking out the depot and outputting |
| 8 annotations for the Buildbot waterfall. | 8 annotations for the Buildbot waterfall. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import errno | 11 import errno |
| 12 import imp | 12 import imp |
| 13 import json | |
| 13 import os | 14 import os |
| 14 import shutil | 15 import shutil |
| 15 import stat | 16 import stat |
| 16 import subprocess | 17 import subprocess |
| 17 import sys | 18 import sys |
| 18 | 19 |
| 19 DEFAULT_GCLIENT_CUSTOM_DEPS = { | 20 DEFAULT_GCLIENT_CUSTOM_DEPS = { |
| 20 'src/data/page_cycler': 'https://chrome-internal.googlesource.com/' | 21 'src/data/page_cycler': 'https://chrome-internal.googlesource.com/' |
| 21 'chrome/data/page_cycler/.git', | 22 'chrome/data/page_cycler/.git', |
| 22 'src/data/dom_perf': 'https://chrome-internal.googlesource.com/' | 23 'src/data/dom_perf': 'https://chrome-internal.googlesource.com/' |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 Returns: | 268 Returns: |
| 268 The return code of the call. | 269 The return code of the call. |
| 269 """ | 270 """ |
| 270 spec = GCLIENT_SPEC_DATA | 271 spec = GCLIENT_SPEC_DATA |
| 271 | 272 |
| 272 if custom_deps: | 273 if custom_deps: |
| 273 for k, v in custom_deps.iteritems(): | 274 for k, v in custom_deps.iteritems(): |
| 274 spec[0]['custom_deps'][k] = v | 275 spec[0]['custom_deps'][k] = v |
| 275 | 276 |
| 276 # Cannot have newlines in string on windows | 277 # Cannot have newlines in string on windows |
| 277 spec = 'solutions =' + str(spec) | 278 spec = 'solutions=' + json.dumps(spec) |
|
qyearsley
2014/09/15 20:30:40
Is the spec interpreted as Python or JSON?
Most J
Sergiy Byelozyorov
2014/09/16 11:24:42
Does gclient interpret this as Python via eval? I
qyearsley
2014/09/16 18:59:18
Yeah, I think that gclient interprets it as Python
Sergiy Byelozyorov
2014/09/17 15:45:18
Done.
| |
| 278 spec = ''.join([l for l in spec.splitlines()]) | |
| 279 | |
| 280 if 'android' in opts.target_platform: | 279 if 'android' in opts.target_platform: |
| 281 spec += GCLIENT_SPEC_ANDROID | 280 spec += GCLIENT_SPEC_ANDROID |
| 282 | 281 |
| 283 return_code = RunGClient( | 282 return_code = RunGClient( |
| 284 ['config', '--spec=%s' % spec], cwd=cwd) | 283 ['config', '--spec=%s' % spec], cwd=cwd) |
| 285 return return_code | 284 return return_code |
| 286 | 285 |
| 287 | 286 |
| 288 | 287 |
| 289 def OnAccessError(func, path, _): | 288 def OnAccessError(func, path, _): |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 372 if opts.output_buildbot_annotations: | 371 if opts.output_buildbot_annotations: |
| 373 OutputAnnotationStepStart(name) | 372 OutputAnnotationStepStart(name) |
| 374 | 373 |
| 375 passed = False | 374 passed = False |
| 376 | 375 |
| 377 if not RunGClientAndCreateConfig(opts, custom_deps): | 376 if not RunGClientAndCreateConfig(opts, custom_deps): |
| 378 passed_deps_check = True | 377 passed_deps_check = True |
| 379 if os.path.isfile(os.path.join('src', FILE_DEPS_GIT)): | 378 if os.path.isfile(os.path.join('src', FILE_DEPS_GIT)): |
| 380 cwd = os.getcwd() | 379 cwd = os.getcwd() |
| 381 os.chdir('src') | 380 os.chdir('src') |
| 382 passed_deps_check = True | |
| 383 if passed_deps_check: | 381 if passed_deps_check: |
| 384 passed_deps_check = RemoveThirdPartyDirectory('libjingle') | 382 passed_deps_check = RemoveThirdPartyDirectory('libjingle') |
| 385 if passed_deps_check: | 383 if passed_deps_check: |
| 386 passed_deps_check = RemoveThirdPartyDirectory('skia') | 384 passed_deps_check = RemoveThirdPartyDirectory('skia') |
| 387 os.chdir(cwd) | 385 os.chdir(cwd) |
| 388 | 386 |
| 389 if passed_deps_check: | 387 if passed_deps_check: |
| 390 _CleanupPreviousGitRuns() | 388 _CleanupPreviousGitRuns() |
| 391 | 389 |
| 392 RunGClient(['revert']) | 390 RunGClient(['revert']) |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 574 return sys.platform.startswith('linux') | 572 return sys.platform.startswith('linux') |
| 575 | 573 |
| 576 | 574 |
| 577 def IsMacHost(): | 575 def IsMacHost(): |
| 578 """Checks whether or not the script is running on Mac. | 576 """Checks whether or not the script is running on Mac. |
| 579 | 577 |
| 580 Returns: | 578 Returns: |
| 581 True if running on Mac. | 579 True if running on Mac. |
| 582 """ | 580 """ |
| 583 return sys.platform.startswith('darwin') | 581 return sys.platform.startswith('darwin') |
| OLD | NEW |