| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 info_p.add_argument( | 344 info_p.add_argument( |
| 345 '--recipes-dir', action='store_true', | 345 '--recipes-dir', action='store_true', |
| 346 help='Get the subpath where the recipes live relative to repository root') | 346 help='Get the subpath where the recipes live relative to repository root') |
| 347 | 347 |
| 348 args = parser.parse_args() | 348 args = parser.parse_args() |
| 349 | 349 |
| 350 if args.verbose: | 350 if args.verbose: |
| 351 logging.getLogger().setLevel(logging.INFO) | 351 logging.getLogger().setLevel(logging.INFO) |
| 352 | 352 |
| 353 repo_root, config_file = get_package_config(args) | 353 repo_root, config_file = get_package_config(args) |
| 354 package_deps = package.PackageDeps.create( | 354 |
| 355 repo_root, config_file, allow_fetch=not args.no_fetch, | 355 try: |
| 356 overrides=args.project_override) | 356 package_deps = package.PackageDeps.create( |
| 357 repo_root, config_file, allow_fetch=not args.no_fetch, |
| 358 overrides=args.project_override) |
| 359 except subprocess.CalledProcessError: |
| 360 # A git checkout failed somewhere. Return 2, which is the sign that this is |
| 361 # an infra failure, rather than a test failure. |
| 362 return 2 |
| 357 | 363 |
| 358 if args.command == 'fetch': | 364 if args.command == 'fetch': |
| 359 # We already did everything in the create() call above. | 365 # We already did everything in the create() call above. |
| 360 assert not args.no_fetch, 'Fetch? No-fetch? Make up your mind!' | 366 assert not args.no_fetch, 'Fetch? No-fetch? Make up your mind!' |
| 361 return 0 | 367 return 0 |
| 362 if args.command == 'simulation_test': | 368 if args.command == 'simulation_test': |
| 363 return simulation_test(package_deps, args) | 369 return simulation_test(package_deps, args) |
| 364 elif args.command == 'lint': | 370 elif args.command == 'lint': |
| 365 return lint(package_deps, args) | 371 return lint(package_deps, args) |
| 366 elif args.command == 'run': | 372 elif args.command == 'run': |
| (...skipping 21 matching lines...) Expand all Loading... |
| 388 | 394 |
| 389 Warmly, | 395 Warmly, |
| 390 recipes.py | 396 recipes.py |
| 391 """ | 397 """ |
| 392 return 1 | 398 return 1 |
| 393 | 399 |
| 394 return 0 | 400 return 0 |
| 395 | 401 |
| 396 if __name__ == '__main__': | 402 if __name__ == '__main__': |
| 397 sys.exit(main()) | 403 sys.exit(main()) |
| OLD | NEW |