OLD | NEW |
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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 """Returns the full path to the buildtools directory. | 691 """Returns the full path to the buildtools directory. |
692 This is based on the root of the checkout containing the current directory.""" | 692 This is based on the root of the checkout containing the current directory.""" |
693 | 693 |
694 # Overriding the build tools path by environment is highly unsupported and may | 694 # Overriding the build tools path by environment is highly unsupported and may |
695 # break without warning. Do not rely on this for anything important. | 695 # break without warning. Do not rely on this for anything important. |
696 override = os.environ.get('CHROMIUM_BUILDTOOLS_PATH') | 696 override = os.environ.get('CHROMIUM_BUILDTOOLS_PATH') |
697 if override is not None: | 697 if override is not None: |
698 return override | 698 return override |
699 | 699 |
700 primary_solution = GetPrimarySolutionPath() | 700 primary_solution = GetPrimarySolutionPath() |
| 701 if primary_solution is None: |
| 702 return None |
701 buildtools_path = os.path.join(primary_solution, 'buildtools') | 703 buildtools_path = os.path.join(primary_solution, 'buildtools') |
702 if not os.path.exists(buildtools_path): | 704 if not os.path.exists(buildtools_path): |
703 # Buildtools may be in the gclient root. | 705 # Buildtools may be in the gclient root. |
704 gclient_root = FindGclientRoot(os.getcwd()) | 706 gclient_root = FindGclientRoot(os.getcwd()) |
705 buildtools_path = os.path.join(gclient_root, 'buildtools') | 707 buildtools_path = os.path.join(gclient_root, 'buildtools') |
706 return buildtools_path | 708 return buildtools_path |
707 | 709 |
708 | 710 |
709 def GetBuildtoolsPlatformBinaryPath(): | 711 def GetBuildtoolsPlatformBinaryPath(): |
710 """Returns the full path to the binary directory for the current platform.""" | 712 """Returns the full path to the binary directory for the current platform.""" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 def DefaultIndexPackConfig(url=''): | 1193 def DefaultIndexPackConfig(url=''): |
1192 """Return reasonable default values for configuring git-index-pack. | 1194 """Return reasonable default values for configuring git-index-pack. |
1193 | 1195 |
1194 Experiments suggest that higher values for pack.threads don't improve | 1196 Experiments suggest that higher values for pack.threads don't improve |
1195 performance.""" | 1197 performance.""" |
1196 cache_limit = DefaultDeltaBaseCacheLimit() | 1198 cache_limit = DefaultDeltaBaseCacheLimit() |
1197 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] | 1199 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] |
1198 if url in THREADED_INDEX_PACK_BLACKLIST: | 1200 if url in THREADED_INDEX_PACK_BLACKLIST: |
1199 result.extend(['-c', 'pack.threads=1']) | 1201 result.extend(['-c', 'pack.threads=1']) |
1200 return result | 1202 return result |
OLD | NEW |