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

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: Add comment indicating just how on-your-own you are if you use this. 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 if 'CHROMIUM_BUILDTOOLS_PATH' in os.environ:
665 override = os.environ['CHROMIUM_BUILDTOOLS_PATH']
iannucci 2014/08/13 22:56:49 os.environ.get could also work val = os.environ.
666 if override != None:
667 return override
668
661 gclient_root = FindGclientRoot(os.getcwd()) 669 gclient_root = FindGclientRoot(os.getcwd())
662 if not gclient_root: 670 if not gclient_root:
663 # Some projects might not use .gclient. Try to see whether we're in a git 671 # Some projects might not use .gclient. Try to see whether we're in a git
664 # checkout. 672 # checkout.
665 top_dir = [os.getcwd()] 673 top_dir = [os.getcwd()]
666 def filter_fn(line): 674 def filter_fn(line):
667 top_dir[0] = os.path.normpath(line.rstrip('\n')) 675 top_dir[0] = os.path.normpath(line.rstrip('\n'))
668 try: 676 try:
669 CheckCallAndFilter(["git", "rev-parse", "--show-toplevel"], 677 CheckCallAndFilter(["git", "rev-parse", "--show-toplevel"],
670 print_stdout=False, filter_fn=filter_fn) 678 print_stdout=False, filter_fn=filter_fn)
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 def DefaultIndexPackConfig(url=''): 1142 def DefaultIndexPackConfig(url=''):
1135 """Return reasonable default values for configuring git-index-pack. 1143 """Return reasonable default values for configuring git-index-pack.
1136 1144
1137 Experiments suggest that higher values for pack.threads don't improve 1145 Experiments suggest that higher values for pack.threads don't improve
1138 performance.""" 1146 performance."""
1139 cache_limit = DefaultDeltaBaseCacheLimit() 1147 cache_limit = DefaultDeltaBaseCacheLimit()
1140 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] 1148 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit]
1141 if url in THREADED_INDEX_PACK_BLACKLIST: 1149 if url in THREADED_INDEX_PACK_BLACKLIST:
1142 result.extend(['-c', 'pack.threads=1']) 1150 result.extend(['-c', 'pack.threads=1'])
1143 return result 1151 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