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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 buildtools_path = os.path.join(primary_solution, 'buildtools') | 701 buildtools_path = os.path.join(primary_solution, 'buildtools') |
702 if not os.path.exists(buildtools_path): | 702 if not os.path.exists(buildtools_path): |
703 # Buildtools may be in the gclient root. | 703 # Buildtools may be in the gclient root. |
704 gclient_root = FindGclientRoot(os.getcwd()) | 704 gclient_root = FindGclientRoot(os.getcwd()) |
705 buildtools_path = os.path.join(gclient_root, 'buildtools') | 705 buildtools_path = os.path.join(gclient_root, 'buildtools') |
706 return buildtools_path | 706 return buildtools_path |
707 | 707 |
708 | 708 |
709 def GetBuildtoolsPlatformBinaryPath(): | 709 def GetBuildtoolsPlatformBinaryPath(): |
710 """Returns the full path to the binary directory for the current platform.""" | 710 """Returns the full path to the binary directory for the current platform.""" |
711 # Mac and Windows just have one directory, Linux has two according to whether | |
712 # it's 32 or 64 bits. | |
713 buildtools_path = GetBuildtoolsPath() | 711 buildtools_path = GetBuildtoolsPath() |
714 if not buildtools_path: | 712 if not buildtools_path: |
715 return None | 713 return None |
716 | 714 |
717 if sys.platform.startswith(('cygwin', 'win')): | 715 if sys.platform.startswith(('cygwin', 'win')): |
718 subdir = 'win' | 716 subdir = 'win' |
719 elif sys.platform == 'darwin': | 717 elif sys.platform == 'darwin': |
720 subdir = 'mac' | 718 subdir = 'mac' |
721 elif sys.platform.startswith('linux'): | 719 elif sys.platform.startswith('linux'): |
722 if sys.maxsize > 2**32: | |
723 subdir = 'linux64' | 720 subdir = 'linux64' |
724 else: | |
725 subdir = 'linux32' | |
726 else: | 721 else: |
727 raise Error('Unknown platform: ' + sys.platform) | 722 raise Error('Unknown platform: ' + sys.platform) |
728 return os.path.join(buildtools_path, subdir) | 723 return os.path.join(buildtools_path, subdir) |
729 | 724 |
730 | 725 |
731 def GetExeSuffix(): | 726 def GetExeSuffix(): |
732 """Returns '' or '.exe' depending on how executables work on this platform.""" | 727 """Returns '' or '.exe' depending on how executables work on this platform.""" |
733 if sys.platform.startswith(('cygwin', 'win')): | 728 if sys.platform.startswith(('cygwin', 'win')): |
734 return '.exe' | 729 return '.exe' |
735 return '' | 730 return '' |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 def DefaultIndexPackConfig(url=''): | 1186 def DefaultIndexPackConfig(url=''): |
1192 """Return reasonable default values for configuring git-index-pack. | 1187 """Return reasonable default values for configuring git-index-pack. |
1193 | 1188 |
1194 Experiments suggest that higher values for pack.threads don't improve | 1189 Experiments suggest that higher values for pack.threads don't improve |
1195 performance.""" | 1190 performance.""" |
1196 cache_limit = DefaultDeltaBaseCacheLimit() | 1191 cache_limit = DefaultDeltaBaseCacheLimit() |
1197 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] | 1192 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] |
1198 if url in THREADED_INDEX_PACK_BLACKLIST: | 1193 if url in THREADED_INDEX_PACK_BLACKLIST: |
1199 result.extend(['-c', 'pack.threads=1']) | 1194 result.extend(['-c', 'pack.threads=1']) |
1200 return result | 1195 return result |
OLD | NEW |