OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The LUCI Authors. All rights reserved. | 2 # Copyright 2015 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 """Tool to interact with recipe repositories. | 6 """Tool to interact with recipe repositories. |
7 | 7 |
8 This tool operates on the nearest ancestor directory containing an | 8 This tool operates on the nearest ancestor directory containing an |
9 infra/config/recipes.cfg. | 9 infra/config/recipes.cfg. |
10 """ | 10 """ |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 | 384 |
385 if args.use_bootstrap and not os.environ.pop('RECIPES_RUN_BOOTSTRAP', None): | 385 if args.use_bootstrap and not os.environ.pop('RECIPES_RUN_BOOTSTRAP', None): |
386 subprocess.check_call( | 386 subprocess.check_call( |
387 [sys.executable, 'bootstrap/bootstrap.py', '--deps-file', | 387 [sys.executable, 'bootstrap/bootstrap.py', '--deps-file', |
388 'bootstrap/deps.pyl', 'ENV'], | 388 'bootstrap/deps.pyl', 'ENV'], |
389 cwd=os.path.dirname(os.path.realpath(__file__))) | 389 cwd=os.path.dirname(os.path.realpath(__file__))) |
390 | 390 |
391 os.environ['RECIPES_RUN_BOOTSTRAP'] = '1' | 391 os.environ['RECIPES_RUN_BOOTSTRAP'] = '1' |
392 args = sys.argv | 392 args = sys.argv |
393 return subprocess.call( | 393 return subprocess.call( |
394 ['ENV/bin/python'] + original_sys_argv, | 394 [os.path.join( |
395 cwd=os.path.dirname(os.path.realpath(__file__))) | 395 os.path.dirname(os.path.realpath(__file__)), 'ENV/bin/python'), |
396 os.path.join(ROOT_DIR, 'recipes.py')] + original_sys_argv[1:]) | |
dnj (Google)
2016/07/11 20:57:06
Are all these forward slashes Windows-compatible?
dnj (Google)
2016/07/11 20:57:06
We already have this value as ROOT_DIR, don't we?
| |
396 | 397 |
397 if args.verbose: | 398 if args.verbose: |
398 logging.getLogger().setLevel(logging.INFO) | 399 logging.getLogger().setLevel(logging.INFO) |
399 | 400 |
400 # Commands which do not require config_file, package_deps, and other objects | 401 # Commands which do not require config_file, package_deps, and other objects |
401 # initialized later. | 402 # initialized later. |
402 if args.command == 'remote': | 403 if args.command == 'remote': |
403 return remote(args) | 404 return remote(args) |
404 | 405 |
405 repo_root, config_file = get_package_config(args) | 406 repo_root, config_file = get_package_config(args) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
461 ret = main() | 462 ret = main() |
462 if not isinstance(ret, int): | 463 if not isinstance(ret, int): |
463 if ret is None: | 464 if ret is None: |
464 ret = 0 | 465 ret = 0 |
465 else: | 466 else: |
466 print >> sys.stderr, ret | 467 print >> sys.stderr, ret |
467 ret = 1 | 468 ret = 1 |
468 sys.stdout.flush() | 469 sys.stdout.flush() |
469 sys.stderr.flush() | 470 sys.stderr.flush() |
470 os._exit(ret) | 471 os._exit(ret) |
OLD | NEW |