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

Side by Side Diff: third_party/binutils/download.py

Issue 263483003: Linux: Handle GYP_DEFINES="host_arch=x86_64" in third_party/binutils/download.py. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 # vim: set ts=2 sw=2 et sts=2 ai: 5 # vim: set ts=2 sw=2 et sts=2 ai:
6 6
7 """Minimal tool to download binutils from Google storage. 7 """Minimal tool to download binutils from Google storage.
8 8
9 TODO(mithro): Replace with generic download_and_extract tool. 9 TODO(mithro): Replace with generic download_and_extract tool.
10 """ 10 """
(...skipping 24 matching lines...) Expand all
35 assert not os.path.exists(filename) 35 assert not os.path.exists(filename)
36 with file(filename, 'w') as f: 36 with file(filename, 'w') as f:
37 f.write(content) 37 f.write(content)
38 f.write('\n') 38 f.write('\n')
39 39
40 40
41 def GetArch(): 41 def GetArch():
42 gyp_host_arch = re.search( 42 gyp_host_arch = re.search(
43 'host_arch=([^ ]*)', os.environ.get('GYP_DEFINES', '')) 43 'host_arch=([^ ]*)', os.environ.get('GYP_DEFINES', ''))
44 if gyp_host_arch: 44 if gyp_host_arch:
45 return gyp_host_arch.group(1) 45 arch = gyp_host_arch.group(1)
46 # This matches detect_host_arch.py.
47 if arch == 'x86_64':
48 return 'x64'
49 return arch
46 50
47 return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip() 51 return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip()
48 52
49 53
50 def FetchAndExtract(arch): 54 def FetchAndExtract(arch):
51 archdir = os.path.join(BINUTILS_DIR, 'Linux_' + arch) 55 archdir = os.path.join(BINUTILS_DIR, 'Linux_' + arch)
52 tarball = os.path.join(archdir, BINUTILS_FILE) 56 tarball = os.path.join(archdir, BINUTILS_FILE)
53 outdir = os.path.join(archdir, BINUTILS_OUT) 57 outdir = os.path.join(archdir, BINUTILS_OUT)
54 58
55 sha1file = tarball + '.sha1' 59 sha1file = tarball + '.sha1'
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if ret != 0: 109 if ret != 0:
106 return ret 110 return ret
107 # Fetch the x64 toolchain as well for official bots with 64-bit kernels. 111 # Fetch the x64 toolchain as well for official bots with 64-bit kernels.
108 return FetchAndExtract('x64') 112 return FetchAndExtract('x64')
109 print "Host architecture %s is not supported." % arch 113 print "Host architecture %s is not supported." % arch
110 return 1 114 return 1
111 115
112 116
113 if __name__ == '__main__': 117 if __name__ == '__main__':
114 sys.exit(main(sys.argv)) 118 sys.exit(main(sys.argv))
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