| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 cwd = os.path.join(buildroot, 'src', 'scripts') | 225 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 226 portage_atom_string = RunCommand(['bin/cros_mark_chrome_as_stable', | 226 portage_atom_string = RunCommand(['bin/cros_mark_chrome_as_stable', |
| 227 '--tracking_branch=%s' % tracking_branch, | 227 '--tracking_branch=%s' % tracking_branch, |
| 228 chrome_rev], cwd=cwd, redirect_stdout=True, | 228 chrome_rev], cwd=cwd, redirect_stdout=True, |
| 229 enter_chroot=True).rstrip() | 229 enter_chroot=True).rstrip() |
| 230 if not portage_atom_string: | 230 if not portage_atom_string: |
| 231 Info('Found nothing to rev.') | 231 Info('Found nothing to rev.') |
| 232 return None | 232 return None |
| 233 else: | 233 else: |
| 234 chrome_atom = portage_atom_string.split('=')[1] | 234 chrome_atom = portage_atom_string.split('=')[1] |
| 235 keywords_file = CHROME_KEYWORDS_FILE % {'board': board} |
| 235 # TODO(sosa): Workaround to build unstable chrome ebuild we uprevved. | 236 # TODO(sosa): Workaround to build unstable chrome ebuild we uprevved. |
| 236 RunCommand(['sudo', 'tee', CHROME_KEYWORDS_FILE % {'board': board}], | 237 RunCommand(['sudo', 'mkdir', '-p', os.path.dirname(keywords_file)], |
| 237 input='=%s\n' % chrome_atom, enter_chroot=True, | 238 enter_chroot=True, cwd=cwd) |
| 238 cwd=cwd) | 239 RunCommand(['sudo', 'tee', keywords_file], input='=%s\n' % chrome_atom, |
| 240 enter_chroot=True, cwd=cwd) |
| 239 return chrome_atom | 241 return chrome_atom |
| 240 | 242 |
| 241 | 243 |
| 242 def _UprevAllPackages(buildroot, tracking_branch, board, overlays): | 244 def _UprevAllPackages(buildroot, tracking_branch, board, overlays): |
| 243 """Uprevs all packages that have been updated since last uprev.""" | 245 """Uprevs all packages that have been updated since last uprev.""" |
| 244 cwd = os.path.join(buildroot, 'src', 'scripts') | 246 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 245 chroot_overlays = [ReinterpretPathForChroot(path) for path in overlays] | 247 chroot_overlays = [ReinterpretPathForChroot(path) for path in overlays] |
| 246 RunCommand(['./cros_mark_as_stable', '--all', | 248 RunCommand(['./cros_mark_as_stable', '--all', |
| 247 '--board=%s' % board, | 249 '--board=%s' % board, |
| 248 '--overlays=%s' % ':'.join(chroot_overlays), | 250 '--overlays=%s' % ':'.join(chroot_overlays), |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 except: | 733 except: |
| 732 # Send failure to master bot. | 734 # Send failure to master bot. |
| 733 if not buildconfig['master'] and buildconfig['important']: | 735 if not buildconfig['master'] and buildconfig['important']: |
| 734 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 736 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
| 735 | 737 |
| 736 raise | 738 raise |
| 737 | 739 |
| 738 | 740 |
| 739 if __name__ == '__main__': | 741 if __name__ == '__main__': |
| 740 main() | 742 main() |
| OLD | NEW |