OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 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 """Downloads and unpacks a toolchain for building on Windows. The contents are | 6 """Downloads and unpacks a toolchain for building on Windows. The contents are |
7 matched by sha1 which will be updated when the toolchain is updated. | 7 matched by sha1 which will be updated when the toolchain is updated. |
8 | 8 |
9 Having a toolchain script in depot_tools means that it's not versioned | 9 Having a toolchain script in depot_tools means that it's not versioned |
10 directly with the source code. That is, if the toolchain is upgraded, but | 10 directly with the source code. That is, if the toolchain is upgraded, but |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 current_hash = CalculateHash(target_dir) | 188 current_hash = CalculateHash(target_dir) |
189 if current_hash not in desired_hashes: | 189 if current_hash not in desired_hashes: |
190 print >> sys.stderr, ( | 190 print >> sys.stderr, ( |
191 'Got wrong hash after pulling a new toolchain. ' | 191 'Got wrong hash after pulling a new toolchain. ' |
192 'Wanted one of \'%s\', got \'%s\'.' % ( | 192 'Wanted one of \'%s\', got \'%s\'.' % ( |
193 desired_hashes, current_hash)) | 193 desired_hashes, current_hash)) |
194 return 1 | 194 return 1 |
195 SaveTimestampsAndHash(target_dir, current_hash) | 195 SaveTimestampsAndHash(target_dir, current_hash) |
196 | 196 |
197 if options.output_json: | 197 if options.output_json: |
198 shutil.copyfile(os.path.join(target_dir, 'data.json'), options.output_json) | 198 shutil.copyfile(os.path.join(target_dir, '..', 'data.json'), |
| 199 options.output_json) |
199 | 200 |
200 return 0 | 201 return 0 |
201 | 202 |
202 | 203 |
203 if __name__ == '__main__': | 204 if __name__ == '__main__': |
204 sys.exit(main()) | 205 sys.exit(main()) |
OLD | NEW |