| 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 # Script to install a Debian Wheezy sysroot for making official Google Chrome | 6 # Script to install a Debian Wheezy sysroot for making official Google Chrome |
| 7 # Linux builds. | 7 # Linux builds. |
| 8 # The sysroot is needed to make Chrome work for Debian Wheezy. | 8 # The sysroot is needed to make Chrome work for Debian Wheezy. |
| 9 # This script can be run manually but is more often run as part of gclient | 9 # This script can be run manually but is more often run as part of gclient |
| 10 # hooks. When run from hooks this script should be a no-op on non-linux | 10 # hooks. When run from hooks this script should be a no-op on non-linux |
| 11 # platforms. | 11 # platforms. |
| 12 | 12 |
| 13 # The sysroot image could be constructed from scratch based on the current | 13 # The sysroot image could be constructed from scratch based on the current |
| 14 # state or Debian Wheezy but for consistency we currently use a pre-built root | 14 # state or Debian Wheezy but for consistency we currently use a pre-built root |
| 15 # image. The image will normally need to be rebuilt every time chrome's build | 15 # image. The image will normally need to be rebuilt every time chrome's build |
| 16 # dependancies are changed. | 16 # dependancies are changed. |
| 17 | 17 |
| 18 import platform | 18 import platform |
| 19 import optparse | 19 import optparse |
| 20 import os | 20 import os |
| 21 import re | 21 import re |
| 22 import shutil | 22 import shutil |
| 23 import subprocess | 23 import subprocess |
| 24 import sys | 24 import sys |
| 25 | 25 |
| 26 | 26 |
| 27 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 27 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 28 URL_PREFIX = 'https://commondatastorage.googleapis.com' | 28 URL_PREFIX = 'https://commondatastorage.googleapis.com' |
| 29 URL_PATH = 'chrome-linux-sysroot/toolchain' | 29 URL_PATH = 'chrome-linux-sysroot/toolchain' |
| 30 REVISION = 36982 | 30 REVISION = 232685 |
| 31 TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz' | 31 TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz' |
| 32 TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz' | 32 TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz' |
| 33 SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot' | 33 SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot' |
| 34 SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot' | 34 SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot' |
| 35 | 35 |
| 36 | 36 |
| 37 def main(args): | 37 def main(args): |
| 38 if options.arch not in ['amd64', 'i386']: | 38 if options.arch not in ['amd64', 'i386']: |
| 39 print 'Unknown architecture: %s' % options.arch | 39 print 'Unknown architecture: %s' % options.arch |
| 40 return 1 | 40 return 1 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 if __name__ == '__main__': | 111 if __name__ == '__main__': |
| 112 parser = optparse.OptionParser('usage: %prog [OPTIONS]') | 112 parser = optparse.OptionParser('usage: %prog [OPTIONS]') |
| 113 parser.add_option('', '--linux-only', dest='linux_only', action='store_true', | 113 parser.add_option('', '--linux-only', dest='linux_only', action='store_true', |
| 114 default=False, help='Only install sysroot for official ' | 114 default=False, help='Only install sysroot for official ' |
| 115 'Linux builds') | 115 'Linux builds') |
| 116 parser.add_option('', '--arch', dest='arch', | 116 parser.add_option('', '--arch', dest='arch', |
| 117 help='Sysroot architecture, i386 or amd64') | 117 help='Sysroot architecture, i386 or amd64') |
| 118 options, args = parser.parse_args() | 118 options, args = parser.parse_args() |
| 119 sys.exit(main(options)) | 119 sys.exit(main(options)) |
| OLD | NEW |