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

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

Issue 290173005: be more lenient with whitespace in GYP_DEFINES (Closed) Base URL: svn://svn.chromium.org/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 22 matching lines...) Expand all
33 33
34 def WriteFile(filename, content): 34 def WriteFile(filename, content):
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=(\S*)', os.environ.get('GYP_DEFINES', ''))
44 if gyp_host_arch: 44 if gyp_host_arch:
45 arch = gyp_host_arch.group(1) 45 arch = gyp_host_arch.group(1)
46 # This matches detect_host_arch.py. 46 # This matches detect_host_arch.py.
47 if arch == 'x86_64': 47 if arch == 'x86_64':
48 return 'x64' 48 return 'x64'
49 return arch 49 return arch
50 50
51 return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip() 51 return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip()
52 52
53 53
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 if ret != 0: 109 if ret != 0:
110 return ret 110 return ret
111 # 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.
112 return FetchAndExtract('x64') 112 return FetchAndExtract('x64')
113 print "Host architecture %s is not supported." % arch 113 print "Host architecture %s is not supported." % arch
114 return 1 114 return 1
115 115
116 116
117 if __name__ == '__main__': 117 if __name__ == '__main__':
118 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