OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client 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 """A library to assist automatically downloading files. | 6 """A library to assist automatically downloading files. |
7 | 7 |
8 This library is used by scripts that download tarballs, zipfiles, etc. as part | 8 This library is used by scripts that download tarballs, zipfiles, etc. as part |
9 of the build process. | 9 of the build process. |
10 """ | 10 """ |
11 | 11 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 EnsureFileCanBeWritten(filename) | 310 EnsureFileCanBeWritten(filename) |
311 http_download.HttpDownload(url, filename) | 311 http_download.HttpDownload(url, filename) |
312 | 312 |
313 if hash_val: | 313 if hash_val: |
314 tar_hash = HashFile(filename) | 314 tar_hash = HashFile(filename) |
315 if hash_val != tar_hash: | 315 if hash_val != tar_hash: |
316 raise HashError(actual_hash=tar_hash, expected_hash=hash_val, | 316 raise HashError(actual_hash=tar_hash, expected_hash=hash_val, |
317 download_url=url) | 317 download_url=url) |
318 | 318 |
319 return True | 319 return True |
OLD | NEW |