Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: recipes.py

Issue 2648723002: Make --deps-path=- put the temp dir in the real temp folder. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 570
571 # If we're using a temporary deps directory, create it. 571 # If we're using a temporary deps directory, create it.
572 temp_deps_dir = None 572 temp_deps_dir = None
573 try: 573 try:
574 # When bootstrapping, re-use the calling wrapper's deps directory instead of 574 # When bootstrapping, re-use the calling wrapper's deps directory instead of
575 # creating a new one. 575 # creating a new one.
576 args.deps_path = os.environ.pop('RECIPES_RUN_BOOTSTRAP_DEPS_DIR', 576 args.deps_path = os.environ.pop('RECIPES_RUN_BOOTSTRAP_DEPS_DIR',
577 args.deps_path) 577 args.deps_path)
578 if args.deps_path == '-': 578 if args.deps_path == '-':
579 # "-" means use a temporary deps path. 579 # "-" means use a temporary deps path.
580 temp_deps_dir = tempfile.mkdtemp(dir=ROOT_DIR, suffix='_deps') 580 temp_deps_dir = tempfile.mkdtemp(suffix='_recipe_deps')
581 args.deps_path = temp_deps_dir 581 args.deps_path = temp_deps_dir
582 582
583 if args.deps_path: 583 if args.deps_path:
584 logging.warning('(Not Bad) Using custom deps path: %s', args.deps_path) 584 logging.warning('(Not Bad) Using custom deps path: %s', args.deps_path)
585 585
586 # If we're bootstrapping, construct our bootstrap environment. If we're 586 # If we're bootstrapping, construct our bootstrap environment. If we're
587 # using a custom deps path, install our enviornment there too. 587 # using a custom deps path, install our enviornment there too.
588 if args.use_bootstrap and not os.environ.pop('RECIPES_RUN_BOOTSTRAP', None): 588 if args.use_bootstrap and not os.environ.pop('RECIPES_RUN_BOOTSTRAP', None):
589 # Propagate our deps path, if specified, so we re-use our temporary 589 # Propagate our deps path, if specified, so we re-use our temporary
590 # directory. 590 # directory.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 710
711 if not isinstance(ret, int): 711 if not isinstance(ret, int):
712 if ret is None: 712 if ret is None:
713 ret = 0 713 ret = 0
714 else: 714 else:
715 print >> sys.stderr, ret 715 print >> sys.stderr, ret
716 ret = 1 716 ret = 1
717 sys.stdout.flush() 717 sys.stdout.flush()
718 sys.stderr.flush() 718 sys.stderr.flush()
719 os._exit(ret) 719 os._exit(ret)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698