| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2015 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 """This script will check out llvm and clang, and then package the results up | 6 """This script will check out llvm and clang, and then package the results up |
| 7 to a tgz file.""" | 7 to a tgz file.""" |
| 8 | 8 |
| 9 import argparse | 9 import argparse |
| 10 import fnmatch | 10 import fnmatch |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 # Check if Google Cloud Storage already has the artifacts we want to build. | 144 # Check if Google Cloud Storage already has the artifacts we want to build. |
| 145 if (args.upload and GsutilArchiveExists(pdir, platform) and | 145 if (args.upload and GsutilArchiveExists(pdir, platform) and |
| 146 not sys.platform.startswith('linux') or | 146 not sys.platform.startswith('linux') or |
| 147 GsutilArchiveExists(golddir, platform)): | 147 GsutilArchiveExists(golddir, platform)): |
| 148 print ('Desired toolchain revision %s is already available ' | 148 print ('Desired toolchain revision %s is already available ' |
| 149 'in Google Cloud Storage:') % expected_stamp | 149 'in Google Cloud Storage:') % expected_stamp |
| 150 print 'gs://chromium-browser-clang/%s/%s.tgz' % (platform, pdir) | 150 print 'gs://chromium-browser-clang/%s/%s.tgz' % (platform, pdir) |
| 151 if sys.platform.startswith('linux'): | 151 if sys.platform.startswith('linux'): |
| 152 print 'gs://chromium-browser-clang/%s/%s.tgz' % (platform, golddir) | 152 print 'gs://chromium-browser-clang/%s/%s.tgz' % (platform, golddir) |
| 153 return 1 | 153 return 0 |
| 154 | 154 |
| 155 with open('buildlog.txt', 'w') as log: | 155 with open('buildlog.txt', 'w') as log: |
| 156 Tee('Diff in llvm:\n', log) | 156 Tee('Diff in llvm:\n', log) |
| 157 TeeCmd(['svn', 'stat', LLVM_DIR], log, fail_hard=False) | 157 TeeCmd(['svn', 'stat', LLVM_DIR], log, fail_hard=False) |
| 158 TeeCmd(['svn', 'diff', LLVM_DIR], log, fail_hard=False) | 158 TeeCmd(['svn', 'diff', LLVM_DIR], log, fail_hard=False) |
| 159 Tee('Diff in llvm/tools/clang:\n', log) | 159 Tee('Diff in llvm/tools/clang:\n', log) |
| 160 TeeCmd(['svn', 'stat', os.path.join(LLVM_DIR, 'tools', 'clang')], | 160 TeeCmd(['svn', 'stat', os.path.join(LLVM_DIR, 'tools', 'clang')], |
| 161 log, fail_hard=False) | 161 log, fail_hard=False) |
| 162 TeeCmd(['svn', 'diff', os.path.join(LLVM_DIR, 'tools', 'clang')], | 162 TeeCmd(['svn', 'diff', os.path.join(LLVM_DIR, 'tools', 'clang')], |
| 163 log, fail_hard=False) | 163 log, fail_hard=False) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 with tarfile.open(golddir + '.tgz', 'w:gz') as tar: | 288 with tarfile.open(golddir + '.tgz', 'w:gz') as tar: |
| 289 tar.add(os.path.join(golddir, 'lib'), arcname='lib', | 289 tar.add(os.path.join(golddir, 'lib'), arcname='lib', |
| 290 filter=PrintTarProgress) | 290 filter=PrintTarProgress) |
| 291 MaybeUpload(args, golddir, platform) | 291 MaybeUpload(args, golddir, platform) |
| 292 | 292 |
| 293 # FIXME: Warn if the file already exists on the server. | 293 # FIXME: Warn if the file already exists on the server. |
| 294 | 294 |
| 295 | 295 |
| 296 if __name__ == '__main__': | 296 if __name__ == '__main__': |
| 297 sys.exit(main()) | 297 sys.exit(main()) |
| OLD | NEW |