| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 """A utility script for downloading versioned Syzygy binaries.""" | 6 """A utility script for downloading versioned Syzygy binaries.""" |
| 7 | 7 |
| 8 import cStringIO | 8 import cStringIO |
| 9 import hashlib | 9 import hashlib |
| 10 import errno | 10 import errno |
| 11 import json | 11 import json |
| 12 import logging | 12 import logging |
| 13 import optparse | 13 import optparse |
| 14 import os | 14 import os |
| 15 import re | 15 import re |
| 16 import shutil | 16 import shutil |
| 17 import stat | 17 import stat |
| 18 import sys | 18 import sys |
| 19 import subprocess | 19 import subprocess |
| 20 import urllib2 | 20 import urllib2 |
| 21 import zipfile | 21 import zipfile |
| 22 | 22 |
| 23 | 23 |
| 24 _LOGGER = logging.getLogger(os.path.basename(__file__)) | 24 _LOGGER = logging.getLogger(os.path.basename(__file__)) |
| 25 | 25 |
| 26 # The URL where official builds are archived. | 26 # The URL where official builds are archived. |
| 27 _SYZYGY_ARCHIVE_URL = ('http://syzygy-archive.commondatastorage.googleapis.com/' | 27 _SYZYGY_ARCHIVE_URL = ('https://syzygy-archive.commondatastorage.googleapis.com' |
| 28 'builds/official/%(revision)s') | 28 '/builds/official/%(revision)s') |
| 29 | 29 |
| 30 # A JSON file containing the state of the download directory. If this file and | 30 # A JSON file containing the state of the download directory. If this file and |
| 31 # directory state do not agree, then the binaries will be downloaded and | 31 # directory state do not agree, then the binaries will be downloaded and |
| 32 # installed again. | 32 # installed again. |
| 33 _STATE = '.state' | 33 _STATE = '.state' |
| 34 | 34 |
| 35 # This matches an integer (an SVN revision number) or a SHA1 value (a GIT hash). | 35 # This matches an integer (an SVN revision number) or a SHA1 value (a GIT hash). |
| 36 # The archive exclusively uses lowercase GIT hashes. | 36 # The archive exclusively uses lowercase GIT hashes. |
| 37 _REVISION_RE = re.compile('^(?:\d+|[a-f0-9]{40})$') | 37 _REVISION_RE = re.compile('^(?:\d+|[a-f0-9]{40})$') |
| 38 | 38 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 # Install the new binaries. In a dry-run this will actually download the | 435 # Install the new binaries. In a dry-run this will actually download the |
| 436 # archives, but it won't write anything to disk. | 436 # archives, but it won't write anything to disk. |
| 437 state = _InstallBinaries(options, deleted) | 437 state = _InstallBinaries(options, deleted) |
| 438 | 438 |
| 439 # Build and save the state for the directory. | 439 # Build and save the state for the directory. |
| 440 _SaveState(options.output_dir, state, options.dry_run) | 440 _SaveState(options.output_dir, state, options.dry_run) |
| 441 | 441 |
| 442 | 442 |
| 443 if __name__ == '__main__': | 443 if __name__ == '__main__': |
| 444 main() | 444 main() |
| OLD | NEW |