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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 489 |
490 remote_location = '%s/%s' % (self._upload_location.rstrip('/'), url_suffix) | 490 remote_location = '%s/%s' % (self._upload_location.rstrip('/'), url_suffix) |
491 if remote_location.startswith('gs://'): | 491 if remote_location.startswith('gs://'): |
492 # Build list of files to upload. | 492 # Build list of files to upload. |
493 upload_files = GenerateUploadDict(package_path, remote_location, uploads) | 493 upload_files = GenerateUploadDict(package_path, remote_location, uploads) |
494 remote_file = '%s/Packages' % remote_location.rstrip('/') | 494 remote_file = '%s/Packages' % remote_location.rstrip('/') |
495 upload_files[tmp_packages_file.name] = remote_file | 495 upload_files[tmp_packages_file.name] = remote_file |
496 | 496 |
497 failed_uploads = RemoteUpload(self._acl, upload_files) | 497 failed_uploads = RemoteUpload(self._acl, upload_files) |
498 if len(failed_uploads) > 1 or (None not in failed_uploads): | 498 if len(failed_uploads) > 1 or (None not in failed_uploads): |
499 error_msg = ['%s -> %s\n' % args for args in failed_uploads] | 499 error_msg = ['%s -> %s\n' % args for args in failed_uploads if args] |
500 raise UploadFailed('Error uploading:\n%s' % error_msg) | 500 raise UploadFailed('Error uploading:\n%s' % error_msg) |
501 else: | 501 else: |
502 pkgs = ' '.join(p['CPV'] + '.tbz2' for p in uploads) | 502 pkgs = ' '.join(p['CPV'] + '.tbz2' for p in uploads) |
503 ssh_server, remote_path = remote_location.split(':', 1) | 503 ssh_server, remote_path = remote_location.split(':', 1) |
504 d = { 'pkg_index': tmp_packages_file.name, | 504 d = { 'pkg_index': tmp_packages_file.name, |
505 'pkgs': pkgs, | 505 'pkgs': pkgs, |
506 'remote_packages': '%s/Packages' % remote_location.rstrip('/'), | 506 'remote_packages': '%s/Packages' % remote_location.rstrip('/'), |
507 'remote_path': remote_path.rstrip('/'), | 507 'remote_path': remote_path.rstrip('/'), |
508 'remote_location': remote_location.rstrip('/'), | 508 'remote_location': remote_location.rstrip('/'), |
509 'ssh_server': ssh_server } | 509 'ssh_server': ssh_server } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 uploader._SyncHostPrebuilts(options.build_path, version, options.key, | 681 uploader._SyncHostPrebuilts(options.build_path, version, options.key, |
682 options.git_sync, options.sync_binhost_conf) | 682 options.git_sync, options.sync_binhost_conf) |
683 | 683 |
684 if options.board: | 684 if options.board: |
685 uploader._SyncBoardPrebuilts(options.board, options.build_path, version, | 685 uploader._SyncBoardPrebuilts(options.board, options.build_path, version, |
686 options.key, options.git_sync, | 686 options.key, options.git_sync, |
687 options.sync_binhost_conf) | 687 options.sync_binhost_conf) |
688 | 688 |
689 if __name__ == '__main__': | 689 if __name__ == '__main__': |
690 main() | 690 main() |
OLD | NEW |