| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 def _SetupBoard(buildroot, board='x86-generic'): | 406 def _SetupBoard(buildroot, board='x86-generic'): |
| 407 """Wrapper around setup_board.""" | 407 """Wrapper around setup_board.""" |
| 408 cwd = os.path.join(buildroot, 'src', 'scripts') | 408 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 409 RunCommand(['./setup_board', '--fast', '--default', '--board=%s' % board], | 409 RunCommand(['./setup_board', '--fast', '--default', '--board=%s' % board], |
| 410 cwd=cwd, enter_chroot=True) | 410 cwd=cwd, enter_chroot=True) |
| 411 | 411 |
| 412 | 412 |
| 413 def _Build(buildroot, emptytree): | 413 def _Build(buildroot, emptytree): |
| 414 """Wrapper around build_packages.""" | 414 """Wrapper around build_packages.""" |
| 415 cwd = os.path.join(buildroot, 'src', 'scripts') | 415 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 416 cmd = ['./build_packages'] | |
| 417 if emptytree: | 416 if emptytree: |
| 418 cmd.insert(0, 'EXTRA_BOARD_FLAGS=--emptytree') | 417 cmd = ['sh', '-c', 'EXTRA_BOARD_FLAGS=--emptytree ./build_packages'] |
| 418 else: |
| 419 cmd = ['./build_packages'] |
| 419 | 420 |
| 420 RunCommand(cmd, cwd=cwd, enter_chroot=True) | 421 RunCommand(cmd, cwd=cwd, enter_chroot=True) |
| 421 | 422 |
| 422 | 423 |
| 423 def _BuildChrome(buildroot, board, chrome_atom_to_build): | 424 def _BuildChrome(buildroot, board, chrome_atom_to_build): |
| 424 """Wrapper for emerge call to build Chrome.""" | 425 """Wrapper for emerge call to build Chrome.""" |
| 425 cwd = os.path.join(buildroot, 'src', 'scripts') | 426 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 426 RunCommand(['emerge-%s' % board, | 427 RunCommand(['emerge-%s' % board, |
| 427 '=%s' % chrome_atom_to_build], | 428 '=%s' % chrome_atom_to_build], |
| 428 cwd=cwd, enter_chroot=True) | 429 cwd=cwd, enter_chroot=True) |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 except: | 800 except: |
| 800 # Send failure to master bot. | 801 # Send failure to master bot. |
| 801 if not buildconfig['master'] and buildconfig['important']: | 802 if not buildconfig['master'] and buildconfig['important']: |
| 802 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 803 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
| 803 | 804 |
| 804 raise | 805 raise |
| 805 | 806 |
| 806 | 807 |
| 807 if __name__ == '__main__': | 808 if __name__ == '__main__': |
| 808 main() | 809 main() |
| OLD | NEW |