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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 print_stdout=False, filter_fn=filter_fn) | 677 print_stdout=False, filter_fn=filter_fn) |
678 except Exception: | 678 except Exception: |
679 pass | 679 pass |
680 top_dir = top_dir[0] | 680 top_dir = top_dir[0] |
681 if os.path.exists(os.path.join(top_dir, 'buildtools')): | 681 if os.path.exists(os.path.join(top_dir, 'buildtools')): |
682 return os.path.join(top_dir, 'buildtools') | 682 return os.path.join(top_dir, 'buildtools') |
683 return None | 683 return None |
684 | 684 |
685 # Some projects' top directory is not named 'src'. | 685 # Some projects' top directory is not named 'src'. |
686 source_dir_name = GetGClientPrimarySolutionName(gclient_root) or 'src' | 686 source_dir_name = GetGClientPrimarySolutionName(gclient_root) or 'src' |
687 return os.path.join(gclient_root, source_dir_name, 'buildtools') | 687 buildtools_path = os.path.join(gclient_root, source_dir_name, 'buildtools') |
| 688 if not os.path.exists(buildtools_path): |
| 689 # Buildtools may be in the gclient root. |
| 690 buildtools_path = os.path.join(gclient_root, 'buildtools') |
| 691 return buildtools_path |
688 | 692 |
689 | 693 |
690 def GetBuildtoolsPlatformBinaryPath(): | 694 def GetBuildtoolsPlatformBinaryPath(): |
691 """Returns the full path to the binary directory for the current platform.""" | 695 """Returns the full path to the binary directory for the current platform.""" |
692 # Mac and Windows just have one directory, Linux has two according to whether | 696 # Mac and Windows just have one directory, Linux has two according to whether |
693 # it's 32 or 64 bits. | 697 # it's 32 or 64 bits. |
694 buildtools_path = GetBuildtoolsPath() | 698 buildtools_path = GetBuildtoolsPath() |
695 if not buildtools_path: | 699 if not buildtools_path: |
696 return None | 700 return None |
697 | 701 |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 def DefaultIndexPackConfig(url=''): | 1159 def DefaultIndexPackConfig(url=''): |
1156 """Return reasonable default values for configuring git-index-pack. | 1160 """Return reasonable default values for configuring git-index-pack. |
1157 | 1161 |
1158 Experiments suggest that higher values for pack.threads don't improve | 1162 Experiments suggest that higher values for pack.threads don't improve |
1159 performance.""" | 1163 performance.""" |
1160 cache_limit = DefaultDeltaBaseCacheLimit() | 1164 cache_limit = DefaultDeltaBaseCacheLimit() |
1161 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] | 1165 result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit] |
1162 if url in THREADED_INDEX_PACK_BLACKLIST: | 1166 if url in THREADED_INDEX_PACK_BLACKLIST: |
1163 result.extend(['-c', 'pack.threads=1']) | 1167 result.extend(['-c', 'pack.threads=1']) |
1164 return result | 1168 return result |
OLD | NEW |