summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis <thakis@chromium.org>2015-06-02 21:17:56 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-03 04:18:24 +0000
commit6f89d8f965bae07a352ee82abe1fb551f65d65e1 (patch)
tree08f5758376d1b67d13adcc11b24a30d1ef9c26ba
parent8a1db1e25199eb1203ba903edf66540b92fc3609 (diff)
downloadchromium_src-6f89d8f965bae07a352ee82abe1fb551f65d65e1.zip
chromium_src-6f89d8f965bae07a352ee82abe1fb551f65d65e1.tar.gz
chromium_src-6f89d8f965bae07a352ee82abe1fb551f65d65e1.tar.bz2
update.py: Download the right cmake on Mac and Linux.
This is slightly different from update.sh: * update.sh only does this for LLVM_FORCE_HEAD_REVISION, update.py does this always if a local build is being done * update.sh only does this if system cmake isn't new enough, update.py never bothers with system cmake Most bots will get prebuilts, it shouldn't make a difference there. BUG=494442 Review URL: https://codereview.chromium.org/1162973003 Cr-Commit-Position: refs/heads/master@{#332551}
-rwxr-xr-xtools/clang/scripts/update.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index 5b2535c..aa74bdc 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -203,15 +203,25 @@ def CreateChromeToolsShim():
def AddCMakeToPath():
"""Download CMake and add it to PATH."""
- cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'cmake-3.2.2-win32-x86', 'bin')
+ if sys.platform == 'win32':
+ zip_name = 'cmake-3.2.2-win32-x86.zip'
+ cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR,
+ 'cmake-3.2.2-win32-x86', 'bin')
+ else:
+ suffix = 'Darwin' if sys.platform == 'darwin' else 'Linux'
+ zip_name = 'cmake310_%s.tgz' % suffix
+ cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'cmake310', 'bin')
if not os.path.exists(cmake_dir):
if not os.path.exists(LLVM_BUILD_TOOLS_DIR):
os.makedirs(LLVM_BUILD_TOOLS_DIR)
# The cmake archive is smaller than 20 MB, small enough to keep in memory:
with contextlib.closing(cStringIO.StringIO()) as f:
- DownloadUrl(CDS_URL + '/tools/cmake-3.2.2-win32-x86.zip', f)
+ DownloadUrl(CDS_URL + '/tools/' + zip_name, f)
f.seek(0)
- zipfile.ZipFile(f).extractall(path=LLVM_BUILD_TOOLS_DIR)
+ if zip_name.endswith('.zip'):
+ zipfile.ZipFile(f).extractall(path=LLVM_BUILD_TOOLS_DIR)
+ else:
+ tarfile.open(mode='r:gz', fileobj=f).extractall(path=LLVM_BUILD_DIR)
os.environ['PATH'] = cmake_dir + os.pathsep + os.environ.get('PATH', '')
vs_version = None