| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS 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 import datetime | 6 import datetime |
| 7 import multiprocessing | 7 import multiprocessing |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 chromiumos-overlay for the host. | 564 chromiumos-overlay for the host. |
| 565 """ | 565 """ |
| 566 # Upload prebuilts. | 566 # Upload prebuilts. |
| 567 package_path = os.path.join(build_path, _HOST_PACKAGES_PATH) | 567 package_path = os.path.join(build_path, _HOST_PACKAGES_PATH) |
| 568 url_suffix = _REL_HOST_PATH % {'version': version, 'target': _HOST_TARGET} | 568 url_suffix = _REL_HOST_PATH % {'version': version, 'target': _HOST_TARGET} |
| 569 packages_url_suffix = '%s/packages' % url_suffix.rstrip('/') | 569 packages_url_suffix = '%s/packages' % url_suffix.rstrip('/') |
| 570 self._UploadPrebuilt(package_path, packages_url_suffix) | 570 self._UploadPrebuilt(package_path, packages_url_suffix) |
| 571 | 571 |
| 572 # Record URL where prebuilts were uploaded. | 572 # Record URL where prebuilts were uploaded. |
| 573 url_value = '%s/%s/' % (self._binhost_base_url.rstrip('/'), | 573 url_value = '%s/%s/' % (self._binhost_base_url.rstrip('/'), |
| 574 url_suffix.rstrip('/')) | 574 packages_url_suffix.rstrip('/')) |
| 575 if git_sync: | 575 if git_sync: |
| 576 git_file = os.path.join(build_path, _PREBUILT_MAKE_CONF[_HOST_TARGET]) | 576 git_file = os.path.join(build_path, _PREBUILT_MAKE_CONF[_HOST_TARGET]) |
| 577 RevGitFile(git_file, url_value, key=key) | 577 RevGitFile(git_file, url_value, key=key) |
| 578 if sync_binhost_conf: | 578 if sync_binhost_conf: |
| 579 binhost_conf = os.path.join(build_path, _BINHOST_CONF_DIR, 'host', | 579 binhost_conf = os.path.join(build_path, _BINHOST_CONF_DIR, 'host', |
| 580 '%s-%s.conf' % (_HOST_TARGET, key)) | 580 '%s-%s.conf' % (_HOST_TARGET, key)) |
| 581 UpdateBinhostConfFile(binhost_conf, key, url_value) | 581 UpdateBinhostConfFile(binhost_conf, key, url_value) |
| 582 | 582 |
| 583 def _SyncBoardPrebuilts(self, board, build_path, version, key, git_sync, | 583 def _SyncBoardPrebuilts(self, board, build_path, version, key, git_sync, |
| 584 sync_binhost_conf, upload_board_tarball): | 584 sync_binhost_conf, upload_board_tarball): |
| (...skipping 25 matching lines...) Expand all Loading... |
| 610 # Upload prebuilts. | 610 # Upload prebuilts. |
| 611 self._UploadPrebuilt(package_path, packages_url_suffix) | 611 self._UploadPrebuilt(package_path, packages_url_suffix) |
| 612 | 612 |
| 613 # Make sure we finished uploading the board tarballs. | 613 # Make sure we finished uploading the board tarballs. |
| 614 if upload_board_tarball: | 614 if upload_board_tarball: |
| 615 tar_process.join() | 615 tar_process.join() |
| 616 assert tar_process.exitcode == 0 | 616 assert tar_process.exitcode == 0 |
| 617 | 617 |
| 618 # Record URL where prebuilts were uploaded. | 618 # Record URL where prebuilts were uploaded. |
| 619 url_value = '%s/%s/' % (self._binhost_base_url.rstrip('/'), | 619 url_value = '%s/%s/' % (self._binhost_base_url.rstrip('/'), |
| 620 url_suffix.rstrip('/')) | 620 packages_url_suffix.rstrip('/')) |
| 621 if git_sync: | 621 if git_sync: |
| 622 git_file = DeterminePrebuiltConfFile(build_path, board) | 622 git_file = DeterminePrebuiltConfFile(build_path, board) |
| 623 RevGitFile(git_file, url_value, key=key) | 623 RevGitFile(git_file, url_value, key=key) |
| 624 if sync_binhost_conf: | 624 if sync_binhost_conf: |
| 625 binhost_conf = os.path.join(build_path, _BINHOST_CONF_DIR, 'target', | 625 binhost_conf = os.path.join(build_path, _BINHOST_CONF_DIR, 'target', |
| 626 '%s-%s.conf' % (board, key)) | 626 '%s-%s.conf' % (board, key)) |
| 627 UpdateBinhostConfFile(binhost_conf, key, url_value) | 627 UpdateBinhostConfFile(binhost_conf, key, url_value) |
| 628 | 628 |
| 629 | 629 |
| 630 def usage(parser, msg): | 630 def usage(parser, msg): |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 options.git_sync, options.sync_binhost_conf) | 731 options.git_sync, options.sync_binhost_conf) |
| 732 | 732 |
| 733 if options.board: | 733 if options.board: |
| 734 uploader._SyncBoardPrebuilts(options.board, options.build_path, version, | 734 uploader._SyncBoardPrebuilts(options.board, options.build_path, version, |
| 735 options.key, options.git_sync, | 735 options.key, options.git_sync, |
| 736 options.sync_binhost_conf, | 736 options.sync_binhost_conf, |
| 737 options.upload_board_tarball) | 737 options.upload_board_tarball) |
| 738 | 738 |
| 739 if __name__ == '__main__': | 739 if __name__ == '__main__': |
| 740 main() | 740 main() |
| OLD | NEW |