| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 """ | 6 """ |
| 7 If should_use_hermetic_xcode.py emits "1", and the current toolchain is out of | 7 If should_use_hermetic_xcode.py emits "1", and the current toolchain is out of |
| 8 date: | 8 date: |
| 9 * Downloads the hermetic mac toolchain | 9 * Downloads the hermetic mac toolchain |
| 10 * Requires gsutil to be configured. | 10 * Requires gsutil to be configured. |
| 11 * Accepts the license. | 11 * Accepts the license. |
| 12 * If xcode-select and xcodebuild are not passwordless in sudoers, requires | 12 * If xcode-select and xcodebuild are not passwordless in sudoers, requires |
| 13 user interaction. | 13 user interaction. |
| 14 """ | 14 """ |
| 15 | 15 |
| 16 import os | 16 import os |
| 17 import plistlib | 17 import plistlib |
| 18 import shutil | 18 import shutil |
| 19 import subprocess | 19 import subprocess |
| 20 import sys | 20 import sys |
| 21 import tarfile | 21 import tarfile |
| 22 import time | 22 import time |
| 23 import tempfile | 23 import tempfile |
| 24 import urllib2 | 24 import urllib2 |
| 25 | 25 |
| 26 # This can be changed after running /build/package_mac_toolchain.py. | 26 # This can be changed after running /build/package_mac_toolchain.py. |
| 27 TOOLCHAIN_REVISION = '5B1008' | 27 TOOLCHAIN_REVISION = '5B1008cqtest' |
| 28 TOOLCHAIN_SUB_REVISION = 3 | 28 TOOLCHAIN_SUB_REVISION = 1 |
| 29 TOOLCHAIN_VERSION = '%s-%s' % (TOOLCHAIN_REVISION, TOOLCHAIN_SUB_REVISION) | 29 TOOLCHAIN_VERSION = '%s-%s' % (TOOLCHAIN_REVISION, TOOLCHAIN_SUB_REVISION) |
| 30 | 30 |
| 31 BASE_DIR = os.path.abspath(os.path.dirname(__file__)) | 31 BASE_DIR = os.path.abspath(os.path.dirname(__file__)) |
| 32 TOOLCHAIN_BUILD_DIR = os.path.join(BASE_DIR, 'mac_files', 'Xcode.app') | 32 TOOLCHAIN_BUILD_DIR = os.path.join(BASE_DIR, 'mac_files', 'Xcode.app') |
| 33 STAMP_FILE = os.path.join(BASE_DIR, 'mac_files', 'toolchain_build_revision') | 33 STAMP_FILE = os.path.join(BASE_DIR, 'mac_files', 'toolchain_build_revision') |
| 34 TOOLCHAIN_URL = 'gs://chrome-mac-sdk/' | 34 TOOLCHAIN_URL = 'gs://chrome-mac-sdk/' |
| 35 | 35 |
| 36 | 36 |
| 37 def ReadStampFile(): | 37 def ReadStampFile(): |
| 38 """Return the contents of the stamp file, or '' if it doesn't exist.""" | 38 """Return the contents of the stamp file, or '' if it doesn't exist.""" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 WriteStampFile(toolchain_revision) | 200 WriteStampFile(toolchain_revision) |
| 201 return 0 | 201 return 0 |
| 202 except Exception as e: | 202 except Exception as e: |
| 203 print 'Failed to download toolchain %s.' % toolchain_file | 203 print 'Failed to download toolchain %s.' % toolchain_file |
| 204 print 'Exception %s' % e | 204 print 'Exception %s' % e |
| 205 print 'Exiting.' | 205 print 'Exiting.' |
| 206 return 1 | 206 return 1 |
| 207 | 207 |
| 208 if __name__ == '__main__': | 208 if __name__ == '__main__': |
| 209 sys.exit(main()) | 209 sys.exit(main()) |
| OLD | NEW |