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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 args = parser.parse_args() | 383 args = parser.parse_args() |
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([os.path.join( |
394 [os.path.join( | 394 ROOT_DIR, 'ENV', 'bin', 'python'), |
dnj
2016/07/11 21:35:52
Note that on Windows this is "python.exe".
martiniss
2016/07/11 23:45:15
Done.
| |
395 os.path.dirname(os.path.realpath(__file__)), 'ENV/bin/python'), | 395 os.path.join(ROOT_DIR, 'recipes.py')] + original_sys_argv[1:]) |
396 os.path.join(ROOT_DIR, 'recipes.py')] + original_sys_argv[1:]) | |
397 | 396 |
398 if args.verbose: | 397 if args.verbose: |
399 logging.getLogger().setLevel(logging.INFO) | 398 logging.getLogger().setLevel(logging.INFO) |
400 | 399 |
401 # Commands which do not require config_file, package_deps, and other objects | 400 # Commands which do not require config_file, package_deps, and other objects |
402 # initialized later. | 401 # initialized later. |
403 if args.command == 'remote': | 402 if args.command == 'remote': |
404 return remote(args) | 403 return remote(args) |
405 | 404 |
406 repo_root, config_file = get_package_config(args) | 405 repo_root, config_file = get_package_config(args) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
462 ret = main() | 461 ret = main() |
463 if not isinstance(ret, int): | 462 if not isinstance(ret, int): |
464 if ret is None: | 463 if ret is None: |
465 ret = 0 | 464 ret = 0 |
466 else: | 465 else: |
467 print >> sys.stderr, ret | 466 print >> sys.stderr, ret |
468 ret = 1 | 467 ret = 1 |
469 sys.stdout.flush() | 468 sys.stdout.flush() |
470 sys.stderr.flush() | 469 sys.stderr.flush() |
471 os._exit(ret) | 470 os._exit(ret) |
OLD | NEW |