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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 RunCommand(['sudo', 'umount', '-l', mount_pt], error_ok=True) | 280 RunCommand(['sudo', 'umount', '-l', mount_pt], error_ok=True) |
281 | 281 |
282 | 282 |
283 def _WipeOldOutput(buildroot): | 283 def _WipeOldOutput(buildroot): |
284 """Wipes out build output directories.""" | 284 """Wipes out build output directories.""" |
285 RunCommand(['rm', '-rf', 'src/build/images'], cwd=buildroot) | 285 RunCommand(['rm', '-rf', 'src/build/images'], cwd=buildroot) |
286 | 286 |
287 | 287 |
288 def _GetChromeOSVersion(buildroot): | 288 def _GetChromeOSVersion(buildroot): |
289 """Returns the tuple version of the Chrome OS version of the buildroot.""" | 289 """Returns the tuple version of the Chrome OS version of the buildroot.""" |
290 cwd = os.path.join(buildroot, 'src', 'scripts') | 290 cwd = os.path.join(buildroot, 'src', 'third_party', 'chromiumos-overlay', |
| 291 'chromeos', 'config') |
291 version_cmd = './chromeos_version.sh' | 292 version_cmd = './chromeos_version.sh' |
292 output = RunCommand(version_cmd, cwd=cwd, redirect_stdout=True, | 293 output = RunCommand(version_cmd, cwd=cwd, redirect_stdout=True, |
293 redirect_stderr=True) | 294 redirect_stderr=True) |
294 version_re = re.compile('\s+CHROMEOS_VERSION_STRING=' | 295 version_re = re.compile('\s+CHROMEOS_VERSION_STRING=' |
295 '(\d+)\.(\d+)\.(\d+)\.(\w+)') | 296 '(\d+)\.(\d+)\.(\d+)\.(\w+)') |
296 for line in output.splitlines(): | 297 for line in output.splitlines(): |
297 match = version_re.match(line) | 298 match = version_re.match(line) |
298 if match: | 299 if match: |
299 return match.group(1), match.group(2), match.group(3), match.group(4) | 300 return match.group(1), match.group(2), match.group(3), match.group(4) |
300 | 301 |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 except: | 793 except: |
793 # Send failure to master bot. | 794 # Send failure to master bot. |
794 if not buildconfig['master'] and buildconfig['important']: | 795 if not buildconfig['master'] and buildconfig['important']: |
795 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 796 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
796 | 797 |
797 raise | 798 raise |
798 | 799 |
799 | 800 |
800 if __name__ == '__main__': | 801 if __name__ == '__main__': |
801 main() | 802 main() |
OLD | NEW |