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 """This module uprevs Chrome for cbuildbot. | 7 """This module uprevs Chrome for cbuildbot. |
8 | 8 |
9 After calling, it prints outs CHROME_VERSION_ATOM=(version atom string). A | 9 After calling, it prints outs CHROME_VERSION_ATOM=(version atom string). A |
10 caller could then use this atom with emerge to build the newly uprevved version | 10 caller could then use this atom with emerge to build the newly uprevved version |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 stable_candidate.ebuild_path_no_revision, | 257 stable_candidate.ebuild_path_no_revision, |
258 stable_candidate.current_revision + 1) | 258 stable_candidate.current_revision + 1) |
259 else: | 259 else: |
260 if chrome_rev == TIP_OF_TRUNK: | 260 if chrome_rev == TIP_OF_TRUNK: |
261 portage_suffix = '_alpha' | 261 portage_suffix = '_alpha' |
262 else: | 262 else: |
263 portage_suffix = '_rc' | 263 portage_suffix = '_rc' |
264 | 264 |
265 new_ebuild_path = base_path + ('%s-r1.ebuild' % portage_suffix) | 265 new_ebuild_path = base_path + ('%s-r1.ebuild' % portage_suffix) |
266 | 266 |
| 267 # Mark latest release and sticky branches as stable. |
| 268 mark_stable = chrome_rev != TIP_OF_TRUNK |
| 269 |
267 cros_mark_as_stable.EBuildStableMarker.MarkAsStable( | 270 cros_mark_as_stable.EBuildStableMarker.MarkAsStable( |
268 unstable_ebuild.ebuild_path, new_ebuild_path, 'CROS_SVN_COMMIT', commit, | 271 unstable_ebuild.ebuild_path, new_ebuild_path, 'CROS_SVN_COMMIT', commit, |
269 make_stable=False) | 272 make_stable=mark_stable) |
270 new_ebuild = ChromeEBuild(new_ebuild_path) | 273 new_ebuild = ChromeEBuild(new_ebuild_path) |
271 if stable_candidate and ( | 274 if stable_candidate and ( |
272 stable_candidate.chrome_version == new_ebuild.chrome_version): | 275 stable_candidate.chrome_version == new_ebuild.chrome_version): |
273 if 0 == RunCommand(['diff', '-Bu', stable_candidate.ebuild_path, | 276 if 0 == RunCommand(['diff', '-Bu', stable_candidate.ebuild_path, |
274 new_ebuild_path], | 277 new_ebuild_path], |
275 redirect_stderr=True, | 278 redirect_stderr=True, |
276 redirect_stdout=True, | 279 redirect_stdout=True, |
277 exit_code=True): | 280 exit_code=True): |
278 Info('Previous ebuild with same version found and no 9999 changes found.' | 281 Info('Previous ebuild with same version found and no 9999 changes found.' |
279 ' Nothing to do.') | 282 ' Nothing to do.') |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 (unstable_ebuild, stable_ebuilds) = FindChromeCandidates(overlay_dir) | 317 (unstable_ebuild, stable_ebuilds) = FindChromeCandidates(overlay_dir) |
315 sticky_ebuild = _GetStickyEBuild(stable_ebuilds) | 318 sticky_ebuild = _GetStickyEBuild(stable_ebuilds) |
316 sticky_version = sticky_ebuild.chrome_version | 319 sticky_version = sticky_ebuild.chrome_version |
317 sticky_branch = sticky_version.rpartition('.')[0] | 320 sticky_branch = sticky_version.rpartition('.')[0] |
318 | 321 |
319 if chrome_rev == TIP_OF_TRUNK: | 322 if chrome_rev == TIP_OF_TRUNK: |
320 version_to_uprev = _GetTipOfTrunkVersion() | 323 version_to_uprev = _GetTipOfTrunkVersion() |
321 commit_to_use = _GetTipOfTrunkSvnRevision() | 324 commit_to_use = _GetTipOfTrunkSvnRevision() |
322 elif chrome_rev == LATEST_RELEASE: | 325 elif chrome_rev == LATEST_RELEASE: |
323 version_to_uprev = _GetLatestRelease() | 326 version_to_uprev = _GetLatestRelease() |
| 327 # Don't rev on stable branch for latest_release. |
| 328 if re.match('%s\.\d+' % sticky_branch, version_to_uprev): |
| 329 Info('Latest release is sticky branch. Nothing to do.') |
| 330 return |
324 else: | 331 else: |
325 version_to_uprev = _GetLatestRelease(sticky_branch) | 332 version_to_uprev = _GetLatestRelease(sticky_branch) |
326 | 333 |
327 stable_candidate = FindChromeUprevCandidate(stable_ebuilds, chrome_rev, | 334 stable_candidate = FindChromeUprevCandidate(stable_ebuilds, chrome_rev, |
328 sticky_branch) | 335 sticky_branch) |
329 | 336 |
| 337 if stable_candidate: |
| 338 Info('Stable candidate found %s' % stable_candidate) |
| 339 else: |
| 340 Info('No stable candidate found.') |
| 341 |
330 os.chdir(overlay_dir) | 342 os.chdir(overlay_dir) |
331 work_branch = cros_mark_as_stable.GitBranch( | 343 work_branch = cros_mark_as_stable.GitBranch( |
332 cros_mark_as_stable.STABLE_BRANCH_NAME, options.tracking_branch) | 344 cros_mark_as_stable.STABLE_BRANCH_NAME, options.tracking_branch) |
333 work_branch.CreateBranch() | 345 work_branch.CreateBranch() |
334 try: | 346 try: |
335 chrome_version_atom = MarkChromeEBuildAsStable( | 347 chrome_version_atom = MarkChromeEBuildAsStable( |
336 stable_candidate, unstable_ebuild, chrome_rev, version_to_uprev, | 348 stable_candidate, unstable_ebuild, chrome_rev, version_to_uprev, |
337 commit_to_use, overlay_dir, sticky_ebuild) | 349 commit_to_use, overlay_dir, sticky_ebuild) |
338 # Explicit print to communicate to caller. | 350 # Explicit print to communicate to caller. |
339 if chrome_version_atom: | 351 if chrome_version_atom: |
340 print 'CHROME_VERSION_ATOM=%s' % chrome_version_atom | 352 print 'CHROME_VERSION_ATOM=%s' % chrome_version_atom |
341 else: | 353 else: |
342 work_branch.Delete() | 354 work_branch.Delete() |
343 except: | 355 except: |
344 work_branch.Delete() | 356 work_branch.Delete() |
345 raise | 357 raise |
346 | 358 |
347 | 359 |
348 if __name__ == '__main__': | 360 if __name__ == '__main__': |
349 main() | 361 main() |
OLD | NEW |