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 re | 10 import re |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 return revisions.items() | 177 return revisions.items() |
178 | 178 |
179 | 179 |
180 def _UprevFromRevisionList(buildroot, revision_list): | 180 def _UprevFromRevisionList(buildroot, revision_list): |
181 """Uprevs based on revision list.""" | 181 """Uprevs based on revision list.""" |
182 if not revision_list: | 182 if not revision_list: |
183 Info('No packages found to uprev') | 183 Info('No packages found to uprev') |
184 return | 184 return |
185 | 185 |
186 package_str = '' | 186 package_str = '' |
187 commit_str = '' | |
188 for package, revision in revision_list: | 187 for package, revision in revision_list: |
189 package_str += package + ' ' | 188 package_str += package + ' ' |
190 commit_str += revision + ' ' | |
191 | 189 |
192 package_str = package_str.strip() | 190 package_str = package_str.strip() |
193 commit_str = commit_str.strip() | |
194 | 191 |
195 cwd = os.path.join(buildroot, 'src', 'scripts') | 192 cwd = os.path.join(buildroot, 'src', 'scripts') |
196 RunCommand(['./cros_mark_as_stable', | 193 RunCommand(['./cros_mark_as_stable', |
197 '--tracking_branch="cros/master"', | 194 '--tracking_branch="cros/master"', |
198 '--packages="%s"' % package_str, | 195 '--packages="%s"' % package_str, |
199 '--commit_ids="%s"' % commit_str, | |
200 'commit'], | 196 'commit'], |
201 cwd=cwd, enter_chroot=True) | 197 cwd=cwd, enter_chroot=True) |
202 | 198 |
203 | 199 |
204 def _UprevAllPackages(buildroot): | 200 def _UprevAllPackages(buildroot): |
205 """Uprevs all packages that have been updated since last uprev.""" | 201 """Uprevs all packages that have been updated since last uprev.""" |
206 cwd = os.path.join(buildroot, 'src', 'scripts') | 202 cwd = os.path.join(buildroot, 'src', 'scripts') |
207 RunCommand(['./cros_mark_all_as_stable', | 203 RunCommand(['./cros_mark_as_stable', '--all', |
208 '--tracking_branch="cros/master"'], | 204 '--tracking_branch="cros/master"', 'commit'], |
209 cwd=cwd, enter_chroot=True) | 205 cwd=cwd, enter_chroot=True) |
210 | 206 |
211 | 207 |
212 def _GetVMConstants(buildroot): | 208 def _GetVMConstants(buildroot): |
213 """Returns minimum (vdisk_size, statefulfs_size) recommended for VM's.""" | 209 """Returns minimum (vdisk_size, statefulfs_size) recommended for VM's.""" |
214 cwd = os.path.join(buildroot, 'src', 'scripts', 'lib') | 210 cwd = os.path.join(buildroot, 'src', 'scripts', 'lib') |
215 source_cmd = 'source %s/cros_vm_constants.sh' % cwd | 211 source_cmd = 'source %s/cros_vm_constants.sh' % cwd |
216 vdisk_size = RunCommand([ | 212 vdisk_size = RunCommand([ |
217 '/bin/bash', '-c', '%s && echo $MIN_VDISK_SIZE_FULL' % source_cmd], | 213 '/bin/bash', '-c', '%s && echo $MIN_VDISK_SIZE_FULL' % source_cmd], |
218 redirect_stdout=True) | 214 redirect_stdout=True) |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 except: | 459 except: |
464 # Send failure to master bot. | 460 # Send failure to master bot. |
465 if not buildconfig['master'] and buildconfig['important']: | 461 if not buildconfig['master'] and buildconfig['important']: |
466 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 462 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
467 | 463 |
468 raise | 464 raise |
469 | 465 |
470 | 466 |
471 if __name__ == '__main__': | 467 if __name__ == '__main__': |
472 main() | 468 main() |
OLD | NEW |