| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 def _GetTipOfTrunkSvnRevision(): | 54 def _GetTipOfTrunkSvnRevision(): |
| 55 """Returns the current svn revision for the chrome tree.""" | 55 """Returns the current svn revision for the chrome tree.""" |
| 56 svn_url = _GetSvnUrl() | 56 svn_url = _GetSvnUrl() |
| 57 svn_info = RunCommand(['svn', 'info', svn_url], redirect_stdout=True) | 57 svn_info = RunCommand(['svn', 'info', svn_url], redirect_stdout=True) |
| 58 | 58 |
| 59 revision_re = re.compile('^Revision:\s+(\d+).*') | 59 revision_re = re.compile('^Revision:\s+(\d+).*') |
| 60 for line in svn_info.splitlines(): | 60 for line in svn_info.splitlines(): |
| 61 match = revision_re.search(line) | 61 match = revision_re.search(line) |
| 62 if match: | 62 if match: |
| 63 return match.group(1) | 63 svn_revision = match.group(1) |
| 64 Info('Using SVN Revision %s' % svn_revision) |
| 65 return svn_revision |
| 64 | 66 |
| 65 raise Exception('Could not find revision information from %s' % svn_url) | 67 raise Exception('Could not find revision information from %s' % svn_url) |
| 66 | 68 |
| 67 | 69 |
| 68 def _GetTipOfTrunkVersion(): | 70 def _GetTipOfTrunkVersion(): |
| 69 """Returns the current Chrome version.""" | 71 """Returns the current Chrome version.""" |
| 70 svn_url = _GetSvnUrl() | 72 svn_url = _GetSvnUrl() |
| 71 chrome_version_file = urllib.urlopen(os.path.join(svn_url, 'src', 'chrome', | 73 chrome_version_file = urllib.urlopen(os.path.join(svn_url, 'src', 'chrome', |
| 72 'VERSION')) | 74 'VERSION')) |
| 73 chrome_version_info = chrome_version_file.read() | 75 chrome_version_info = chrome_version_file.read() |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 print 'CHROME_VERSION_ATOM=%s' % chrome_version_atom | 354 print 'CHROME_VERSION_ATOM=%s' % chrome_version_atom |
| 353 else: | 355 else: |
| 354 work_branch.Delete() | 356 work_branch.Delete() |
| 355 except: | 357 except: |
| 356 work_branch.Delete() | 358 work_branch.Delete() |
| 357 raise | 359 raise |
| 358 | 360 |
| 359 | 361 |
| 360 if __name__ == '__main__': | 362 if __name__ == '__main__': |
| 361 main() | 363 main() |
| OLD | NEW |