OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" | 7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" |
8 | 8 |
9 import errno | 9 import errno |
10 import heapq | 10 import heapq |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 public_overlay = '%s/src/third_party/chromiumos-overlay' % buildroot | 477 public_overlay = '%s/src/third_party/chromiumos-overlay' % buildroot |
478 private_overlay = '%s/src/private-overlays/chromeos-overlay' % buildroot | 478 private_overlay = '%s/src/private-overlays/chromeos-overlay' % buildroot |
479 if overlays == 'private': | 479 if overlays == 'private': |
480 paths = [private_overlay] | 480 paths = [private_overlay] |
481 elif overlays == 'public': | 481 elif overlays == 'public': |
482 paths = [public_overlay] | 482 paths = [public_overlay] |
483 elif overlays == 'both': | 483 elif overlays == 'both': |
484 paths = [public_overlay, private_overlay] | 484 paths = [public_overlay, private_overlay] |
485 else: | 485 else: |
486 Die('Incorrect overlay configuration: %s' % overlays) | 486 Die('Incorrect overlay configuration: %s' % overlays) |
487 for path in paths: | |
488 assert ':' not in path, 'Overlay must not contain colons: %s' % path | |
489 if not os.path.isdir(path): | |
490 Die('Missing overlay: %s' % path) | |
491 return paths | 487 return paths |
492 | 488 |
493 | 489 |
494 def main(): | 490 def main(): |
495 # Parse options | 491 # Parse options |
496 usage = "usage: %prog [options] cbuildbot_config" | 492 usage = "usage: %prog [options] cbuildbot_config" |
497 parser = optparse.OptionParser(usage=usage) | 493 parser = optparse.OptionParser(usage=usage) |
498 parser.add_option('-r', '--buildroot', | 494 parser.add_option('-r', '--buildroot', |
499 help='root directory where build occurs', default=".") | 495 help='root directory where build occurs', default=".") |
500 parser.add_option('-n', '--buildnumber', | 496 parser.add_option('-n', '--buildnumber', |
(...skipping 28 matching lines...) Expand all Loading... | |
529 # Calculate list of overlay directories. | 525 # Calculate list of overlay directories. |
530 overlays = _ResolveOverlays(buildroot, buildconfig['overlays']) | 526 overlays = _ResolveOverlays(buildroot, buildconfig['overlays']) |
531 | 527 |
532 try: | 528 try: |
533 _PreFlightRinse(buildroot, buildconfig['board'], tracking_branch, overlays) | 529 _PreFlightRinse(buildroot, buildconfig['board'], tracking_branch, overlays) |
534 if options.clobber or not os.path.isdir(buildroot): | 530 if options.clobber or not os.path.isdir(buildroot): |
535 _FullCheckout(buildroot, tracking_branch, url=options.url) | 531 _FullCheckout(buildroot, tracking_branch, url=options.url) |
536 else: | 532 else: |
537 _IncrementalCheckout(buildroot) | 533 _IncrementalCheckout(buildroot) |
538 | 534 |
535 # Check that all overlays can be found. | |
536 for path in overlays: | |
537 assert ':' not in path, 'Overlay must not contain colons: %s' % path | |
scottz
2010/11/16 03:45:42
Why are we putting asserts in here still? From you
| |
538 if not os.path.isdir(path): | |
539 Die('Missing overlay: %s' % path) | |
540 | |
539 chroot_path = os.path.join(buildroot, 'chroot') | 541 chroot_path = os.path.join(buildroot, 'chroot') |
540 if not os.path.isdir(chroot_path): | 542 if not os.path.isdir(chroot_path): |
541 _MakeChroot(buildroot) | 543 _MakeChroot(buildroot) |
542 | 544 |
543 boardpath = os.path.join(chroot_path, 'build', buildconfig['board']) | 545 boardpath = os.path.join(chroot_path, 'build', buildconfig['board']) |
544 if not os.path.isdir(boardpath): | 546 if not os.path.isdir(boardpath): |
545 _SetupBoard(buildroot, board=buildconfig['board']) | 547 _SetupBoard(buildroot, board=buildconfig['board']) |
546 | 548 |
547 if buildconfig['uprev']: | 549 if buildconfig['uprev']: |
548 _UprevPackages(buildroot, tracking_branch, revisionfile, | 550 _UprevPackages(buildroot, tracking_branch, revisionfile, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 except: | 586 except: |
585 # Send failure to master bot. | 587 # Send failure to master bot. |
586 if not buildconfig['master'] and buildconfig['important']: | 588 if not buildconfig['master'] and buildconfig['important']: |
587 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 589 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
588 | 590 |
589 raise | 591 raise |
590 | 592 |
591 | 593 |
592 if __name__ == '__main__': | 594 if __name__ == '__main__': |
593 main() | 595 main() |
OLD | NEW |