OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2017 The LUCI Authors. All rights reserved. | 2 # Copyright 2017 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
5 | 5 |
6 import argparse | 6 import argparse |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 | 11 |
12 LOGGER = logging.getLogger(__name__) | 12 LOGGER = logging.getLogger(__name__) |
13 IS_WINDOWS = sys.platform == 'win32' | 13 IS_WINDOWS = sys.platform == 'win32' |
14 EXE_EXTENSION = '.bat' if IS_WINDOWS else '' | 14 EXE_EXTENSION = '.bat' if IS_WINDOWS else '' |
15 | 15 |
16 # /path/to/recipes-py | 16 # /path/to/recipes-py |
17 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 17 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
18 CIPD_ROOT = os.path.join(ROOT, '.cipd_root') | 18 CIPD_ROOT = os.path.join(ROOT, '.cipd_root') |
19 | 19 |
20 VPYTHON_PACKAGE = 'infra/tools/luci/vpython/${platform}' | 20 VPYTHON_PACKAGE = 'infra/tools/luci/vpython/${platform}' |
21 VPYTHON_VERSION = 'git_revision:ea5f3c7c274276673049e6bc2fa2619b1f55d589' | 21 VPYTHON_VERSION = 'git_revision:4ff2211fe419a7a0083ea2010ea8b33fb5e342a9' |
22 | 22 |
23 | 23 |
24 def _ensure_vpython(cipd_root): | 24 def _ensure_vpython(cipd_root): |
25 manifest = '%s %s' % (VPYTHON_PACKAGE, VPYTHON_VERSION) | 25 manifest = '%s %s' % (VPYTHON_PACKAGE, VPYTHON_VERSION) |
26 | 26 |
27 cipd_bin = 'cipd' + EXE_EXTENSION | 27 cipd_bin = 'cipd' + EXE_EXTENSION |
28 cmd = [cipd_bin, 'ensure', '-root', cipd_root, '-ensure-file=-'] | 28 cmd = [cipd_bin, 'ensure', '-root', cipd_root, '-ensure-file=-'] |
29 | 29 |
30 LOGGER.debug('Running CIPD ensure command (cwd=%s): %s', os.getcwd(), cmd) | 30 LOGGER.debug('Running CIPD ensure command (cwd=%s): %s', os.getcwd(), cmd) |
31 proc = subprocess.Popen( | 31 proc = subprocess.Popen( |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return subprocess.call(vpython_args) | 88 return subprocess.call(vpython_args) |
89 | 89 |
90 vpython_args += ['--'] + opts.args | 90 vpython_args += ['--'] + opts.args |
91 LOGGER.debug('Executing bootstrapped Python: %s', vpython_args) | 91 LOGGER.debug('Executing bootstrapped Python: %s', vpython_args) |
92 return subprocess.call(vpython_args) | 92 return subprocess.call(vpython_args) |
93 | 93 |
94 | 94 |
95 if __name__ == '__main__': | 95 if __name__ == '__main__': |
96 logging.basicConfig() | 96 logging.basicConfig() |
97 sys.exit(main(sys.argv[1:])) | 97 sys.exit(main(sys.argv[1:])) |
OLD | NEW |