OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Script that reads omahaproxy and gsutil to determine version of SDK to put | 6 """Script that reads omahaproxy and gsutil to determine version of SDK to put |
7 in manifest. | 7 in manifest. |
8 """ | 8 """ |
9 | 9 |
10 import buildbot_common | 10 import buildbot_common |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 | 460 |
461 def Update(self, manifest): | 461 def Update(self, manifest): |
462 """Update a manifest and upload it. | 462 """Update a manifest and upload it. |
463 | 463 |
464 Args: | 464 Args: |
465 manifest: The manifest used as a template for updating. Only pepper | 465 manifest: The manifest used as a template for updating. Only pepper |
466 bundles that contain no archives will be considered for auto-updating.""" | 466 bundles that contain no archives will be considered for auto-updating.""" |
467 for bundle_name, version, channel, archives in self.versions_to_update: | 467 for bundle_name, version, channel, archives in self.versions_to_update: |
468 self.delegate.Print('Updating %s to %s...' % (bundle_name, version)) | 468 self.delegate.Print('Updating %s to %s...' % (bundle_name, version)) |
469 bundle = manifest.GetBundle(bundle_name) | 469 bundle = manifest.GetBundle(bundle_name) |
470 bundle_recommended = bundle.recommended | |
471 for archive in archives: | 470 for archive in archives: |
472 platform_bundle = self._GetPlatformArchiveBundle(archive) | 471 platform_bundle = self._GetPlatformArchiveBundle(archive) |
473 # Normally the manifest snippet's bundle name matches our bundle name. | 472 # Normally the manifest snippet's bundle name matches our bundle name. |
474 # pepper_canary, however is called "pepper_###" in the manifest | 473 # pepper_canary, however is called "pepper_###" in the manifest |
475 # snippet. | 474 # snippet. |
476 platform_bundle.name = bundle_name | 475 platform_bundle.name = bundle_name |
477 bundle.MergeWithBundle(platform_bundle) | 476 bundle.MergeWithBundle(platform_bundle) |
478 bundle.stability = channel | 477 bundle.stability = channel |
479 bundle.recommended = bundle_recommended | 478 # We always recommend the stable version. |
479 if channel == 'stable': | |
480 bundle.recommended = 'yes' | |
481 else: | |
482 bundle.recommended = 'no' | |
noelallen1
2012/07/09 21:58:39
Does the no mean we don't recommend anything but?
binji
2012/07/09 22:06:29
That's what I figured... I've pretty much been upd
| |
480 manifest.MergeBundle(bundle) | 483 manifest.MergeBundle(bundle) |
481 self._UploadManifest(manifest) | 484 self._UploadManifest(manifest) |
482 self.delegate.Print('Done.') | 485 self.delegate.Print('Done.') |
483 | 486 |
484 def _GetPlatformArchiveBundle(self, archive): | 487 def _GetPlatformArchiveBundle(self, archive): |
485 """Downloads the manifest "snippet" for an archive, and reads it as a | 488 """Downloads the manifest "snippet" for an archive, and reads it as a |
486 Bundle. | 489 Bundle. |
487 | 490 |
488 Args: | 491 Args: |
489 archive: A full URL of a platform-specific archive, using the gs schema. | 492 archive: A full URL of a platform-specific archive, using the gs schema. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 subject = '[%s] Failed to update manifest' % (scriptname,) | 621 subject = '[%s] Failed to update manifest' % (scriptname,) |
619 text = '%s failed.\n\nSTDERR:\n%s\n' % (scriptname, sys.stderr.getvalue()) | 622 text = '%s failed.\n\nSTDERR:\n%s\n' % (scriptname, sys.stderr.getvalue()) |
620 SendMail(options.mailfrom, options.mailto, subject, text) | 623 SendMail(options.mailfrom, options.mailto, subject, text) |
621 sys.exit(1) | 624 sys.exit(1) |
622 else: | 625 else: |
623 raise | 626 raise |
624 | 627 |
625 | 628 |
626 if __name__ == '__main__': | 629 if __name__ == '__main__': |
627 sys.exit(main(sys.argv)) | 630 sys.exit(main(sys.argv)) |
OLD | NEW |