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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 print 'Failed:', cmd | 51 print 'Failed:', cmd |
52 sys.exit(1) | 52 sys.exit(1) |
53 | 53 |
54 | 54 |
55 def PrintTarProgress(tarinfo): | 55 def PrintTarProgress(tarinfo): |
56 print 'Adding', tarinfo.name | 56 print 'Adding', tarinfo.name |
57 return tarinfo | 57 return tarinfo |
58 | 58 |
59 | 59 |
60 def main(): | 60 def main(): |
| 61 if sys.platform == 'win32': |
| 62 try: |
| 63 subprocess.check_output(['grep', '--help'], shell=True) |
| 64 except subprocess.CalledProcessError: |
| 65 print 'Add gnuwin32 to your PATH, then try again.' |
| 66 return 1 |
| 67 |
61 parser = argparse.ArgumentParser(description='build and package clang') | 68 parser = argparse.ArgumentParser(description='build and package clang') |
62 parser.add_argument('--gcc-toolchain', | 69 parser.add_argument('--gcc-toolchain', |
63 help="the prefix for the GCC version used for building. " | 70 help="the prefix for the GCC version used for building. " |
64 "For /opt/foo/bin/gcc, pass " | 71 "For /opt/foo/bin/gcc, pass " |
65 "'--gcc-toolchain '/opt/foo'") | 72 "'--gcc-toolchain '/opt/foo'") |
66 | 73 |
67 args = parser.parse_args() | 74 args = parser.parse_args() |
68 | 75 |
69 with open('buildlog.txt', 'w') as log: | 76 with open('buildlog.txt', 'w') as log: |
70 Tee('Diff in llvm:\n', log) | 77 Tee('Diff in llvm:\n', log) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 filter=PrintTarProgress) | 236 filter=PrintTarProgress) |
230 print ('gsutil cp -a public-read %s.tgz ' | 237 print ('gsutil cp -a public-read %s.tgz ' |
231 'gs://chromium-browser-clang/%s/%s.tgz') % (golddir, platform, | 238 'gs://chromium-browser-clang/%s/%s.tgz') % (golddir, platform, |
232 golddir) | 239 golddir) |
233 | 240 |
234 # FIXME: Warn if the file already exists on the server. | 241 # FIXME: Warn if the file already exists on the server. |
235 | 242 |
236 | 243 |
237 if __name__ == '__main__': | 244 if __name__ == '__main__': |
238 sys.exit(main()) | 245 sys.exit(main()) |
OLD | NEW |