| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 print 'Uploading %s' % package_string | 434 print 'Uploading %s' % package_string |
| 435 failed_uploads = RemoteUpload(upload_files) | 435 failed_uploads = RemoteUpload(upload_files) |
| 436 if len(failed_uploads) > 1 or (None not in failed_uploads): | 436 if len(failed_uploads) > 1 or (None not in failed_uploads): |
| 437 error_msg = ['%s -> %s\n' % args for args in failed_uploads] | 437 error_msg = ['%s -> %s\n' % args for args in failed_uploads] |
| 438 raise UploadFailed('Error uploading:\n%s' % error_msg) | 438 raise UploadFailed('Error uploading:\n%s' % error_msg) |
| 439 else: | 439 else: |
| 440 pkgs = ' '.join(p['CPV'] + '.tbz2' for p in uploads) | 440 pkgs = ' '.join(p['CPV'] + '.tbz2' for p in uploads) |
| 441 ssh_server, remote_path = remote_location.split(':', 1) | 441 ssh_server, remote_path = remote_location.split(':', 1) |
| 442 d = { 'pkg_index': tmp_packages_file.name, | 442 d = { 'pkg_index': tmp_packages_file.name, |
| 443 'pkgs': pkgs, | 443 'pkgs': pkgs, |
| 444 'remote_packages': '%s/Packages' % remote_location.rstrip('/'), |
| 444 'remote_path': remote_path, | 445 'remote_path': remote_path, |
| 445 'remote_location': remote_location, | 446 'remote_location': remote_location, |
| 446 'ssh_server': ssh_server } | 447 'ssh_server': ssh_server } |
| 447 cmds = ['ssh %(ssh_server)s mkdir -p %(remote_path)s' % d, | 448 cmds = ['ssh %(ssh_server)s mkdir -p %(remote_path)s' % d, |
| 448 'rsync -av %(pkg_index)s %(remote_location)s/Packages' % d] | 449 'rsync -av --chmod=a+r %(pkg_index)s %(remote_packages)s' % d] |
| 449 if pkgs: | 450 if pkgs: |
| 450 cmds.append('rsync -Rav %(pkgs)s %(remote_location)s/' % d) | 451 cmds.append('rsync -Rav %(pkgs)s %(remote_location)s/' % d) |
| 451 for cmd in cmds: | 452 for cmd in cmds: |
| 452 if not _RetryRun(cmd, shell=True, cwd=package_path): | 453 if not _RetryRun(cmd, shell=True, cwd=package_path): |
| 453 raise UploadFailed('Could not run %s' % cmd) | 454 raise UploadFailed('Could not run %s' % cmd) |
| 454 | 455 |
| 455 url_value = '%s/%s/' % (binhost_base_url, url_suffix) | 456 url_value = '%s/%s/' % (binhost_base_url, url_suffix) |
| 456 | 457 |
| 457 if git_sync: | 458 if git_sync: |
| 458 RevGitFile(git_file, url_value, retries=git_sync_retries, key=key) | 459 RevGitFile(git_file, url_value, retries=git_sync_retries, key=key) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 if options.board: | 533 if options.board: |
| 533 UploadPrebuilt(options.build_path, options.upload, version, | 534 UploadPrebuilt(options.build_path, options.upload, version, |
| 534 options.binhost_base_url, board=options.board, | 535 options.binhost_base_url, board=options.board, |
| 535 git_sync=options.git_sync, key=options.key, | 536 git_sync=options.git_sync, key=options.key, |
| 536 pkg_indexes=pkg_indexes, | 537 pkg_indexes=pkg_indexes, |
| 537 sync_binhost_conf=options.sync_binhost_conf) | 538 sync_binhost_conf=options.sync_binhost_conf) |
| 538 | 539 |
| 539 | 540 |
| 540 if __name__ == '__main__': | 541 if __name__ == '__main__': |
| 541 main() | 542 main() |
| OLD | NEW |