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

Side by Side Diff: gclient_utils.py

Issue 472553003: Allow chromium buildtools path to be overriden in the environment. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fix my poor python. Created 6 years, 4 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generic utils.""" 5 """Generic utils."""
6 6
7 import codecs 7 import codecs
8 import cStringIO 8 import cStringIO
9 import datetime 9 import datetime
10 import logging 10 import logging
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 elif sys.platform.startswith('linux'): 651 elif sys.platform.startswith('linux'):
652 return 'linux' 652 return 'linux'
653 elif sys.platform == 'darwin': 653 elif sys.platform == 'darwin':
654 return 'mac' 654 return 'mac'
655 raise Error('Unknown platform: ' + sys.platform) 655 raise Error('Unknown platform: ' + sys.platform)
656 656
657 657
658 def GetBuildtoolsPath(): 658 def GetBuildtoolsPath():
659 """Returns the full path to the buildtools directory. 659 """Returns the full path to the buildtools directory.
660 This is based on the root of the checkout containing the current directory.""" 660 This is based on the root of the checkout containing the current directory."""
661
662 # Overriding the build tools path by environment is highly unsupported and may
663 # break without warning. Do not rely on this for anything important.
664 override = os.environ.get('CHROMIUM_BUILDTOOLS_PATH')
665 if override is not None:
666 return override
667
661 gclient_root = FindGclientRoot(os.getcwd()) 668 gclient_root = FindGclientRoot(os.getcwd())
662 if not gclient_root: 669 if not gclient_root:
663 # Some projects might not use .gclient. Try to see whether we're in a git 670 # Some projects might not use .gclient. Try to see whether we're in a git
664 # checkout. 671 # checkout.
665 top_dir = [os.getcwd()] 672 top_dir = [os.getcwd()]
666 def filter_fn(line): 673 def filter_fn(line):
667 top_dir[0] = os.path.normpath(line.rstrip('\n')) 674 top_dir[0] = os.path.normpath(line.rstrip('\n'))
668 try: 675 try:
669 CheckCallAndFilter(["git", "rev-parse", "--show-toplevel"], 676 CheckCallAndFilter(["git", "rev-parse", "--show-toplevel"],
670 print_stdout=False, filter_fn=filter_fn) 677 print_stdout=False, filter_fn=filter_fn)
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 def DefaultIndexPackConfig(url=''): 1141 def DefaultIndexPackConfig(url=''):
1135 """Return reasonable default values for configuring git-index-pack. 1142 """Return reasonable default values for configuring git-index-pack.
1136 1143
1137 Experiments suggest that higher values for pack.threads don't improve 1144 Experiments suggest that higher values for pack.threads don't improve
1138 performance.""" 1145 performance."""
1139 cache_limit = DefaultDeltaBaseCacheLimit() 1146 cache_limit = DefaultDeltaBaseCacheLimit()
1140 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] 1147 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit]
1141 if url in THREADED_INDEX_PACK_BLACKLIST: 1148 if url in THREADED_INDEX_PACK_BLACKLIST:
1142 result.extend(['-c', 'pack.threads=1']) 1149 result.extend(['-c', 'pack.threads=1'])
1143 return result 1150 return result
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