OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 | 5 |
6 """Install Debian sysroots for building chromium. | 6 """Install Debian sysroots for building chromium. |
7 """ | 7 """ |
8 | 8 |
9 # The sysroot is needed to ensure that binaries will run on Debian Wheezy, | 9 # The sysroot is needed to ensure that binaries will run on Debian Wheezy, |
10 # the oldest supported linux distribution. For ARM64 linux, we have Debian | 10 # the oldest supported linux distribution. For ARM64 linux, we have Debian |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 print 'Installing Debian %s %s root image: %s' % \ | 239 print 'Installing Debian %s %s root image: %s' % \ |
240 (target_platform, target_arch, sysroot) | 240 (target_platform, target_arch, sysroot) |
241 if os.path.isdir(sysroot): | 241 if os.path.isdir(sysroot): |
242 shutil.rmtree(sysroot) | 242 shutil.rmtree(sysroot) |
243 os.mkdir(sysroot) | 243 os.mkdir(sysroot) |
244 tarball = os.path.join(sysroot, tarball_filename) | 244 tarball = os.path.join(sysroot, tarball_filename) |
245 print 'Downloading %s' % url | 245 print 'Downloading %s' % url |
246 sys.stdout.flush() | 246 sys.stdout.flush() |
247 sys.stderr.flush() | 247 sys.stderr.flush() |
248 subprocess.check_call( | 248 subprocess.check_call( |
249 ['curl', '--fail', '--retry', '3', '-L', url, '-o', tarball]) | 249 ['wget', '--quiet', '-t', '3', '-O', tarball, url]) |
250 sha1sum = GetSha1(tarball) | 250 sha1sum = GetSha1(tarball) |
251 if sha1sum != tarball_sha1sum: | 251 if sha1sum != tarball_sha1sum: |
252 raise Error('Tarball sha1sum is wrong.' | 252 raise Error('Tarball sha1sum is wrong.' |
253 'Expected %s, actual: %s' % (tarball_sha1sum, sha1sum)) | 253 'Expected %s, actual: %s' % (tarball_sha1sum, sha1sum)) |
254 subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot]) | 254 subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot]) |
255 os.remove(tarball) | 255 os.remove(tarball) |
256 | 256 |
257 with open(stamp, 'w') as s: | 257 with open(stamp, 'w') as s: |
258 s.write(url) | 258 s.write(url) |
259 | 259 |
260 | 260 |
261 if __name__ == '__main__': | 261 if __name__ == '__main__': |
262 try: | 262 try: |
263 sys.exit(main(sys.argv[1:])) | 263 sys.exit(main(sys.argv[1:])) |
264 except Error as e: | 264 except Error as e: |
265 sys.stderr.write(str(e) + '\n') | 265 sys.stderr.write(str(e) + '\n') |
266 sys.exit(1) | 266 sys.exit(1) |
OLD | NEW |