| 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 a given package's ebuild to the next revision.""" | 7 """This module uprevs a given package's ebuild to the next revision.""" |
| 8 | 8 |
| 9 | 9 |
| 10 import fileinput | 10 import fileinput |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 _SimpleRunCommand('git push') | 241 _SimpleRunCommand('git push') |
| 242 | 242 |
| 243 | 243 |
| 244 def _SimpleRunCommand(command): | 244 def _SimpleRunCommand(command): |
| 245 """Runs a shell command and returns stdout back to caller.""" | 245 """Runs a shell command and returns stdout back to caller.""" |
| 246 _Print(' + %s' % command) | 246 _Print(' + %s' % command) |
| 247 proc_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) | 247 proc_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) |
| 248 stdout = proc_handle.communicate()[0] | 248 stdout = proc_handle.communicate()[0] |
| 249 retcode = proc_handle.wait() | 249 retcode = proc_handle.wait() |
| 250 if retcode != 0: | 250 if retcode != 0: |
| 251 raise subprocess.CalledProcessError(retcode, command, output=stdout) | 251 _Print(stdout) |
| 252 raise subprocess.CalledProcessError(retcode, command) |
| 252 return stdout | 253 return stdout |
| 253 | 254 |
| 254 | 255 |
| 255 # ======================= End Global Helper Functions ======================== | 256 # ======================= End Global Helper Functions ======================== |
| 256 | 257 |
| 257 | 258 |
| 258 class _GitBranch(object): | 259 class _GitBranch(object): |
| 259 """Wrapper class for a git branch.""" | 260 """Wrapper class for a git branch.""" |
| 260 | 261 |
| 261 def __init__(self, branch_name): | 262 def __init__(self, branch_name): |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 raise | 549 raise |
| 549 | 550 |
| 550 if revved_packages: | 551 if revved_packages: |
| 551 _CleanStalePackages(gflags.FLAGS.board, revved_packages) | 552 _CleanStalePackages(gflags.FLAGS.board, revved_packages) |
| 552 else: | 553 else: |
| 553 work_branch.Delete() | 554 work_branch.Delete() |
| 554 | 555 |
| 555 | 556 |
| 556 if __name__ == '__main__': | 557 if __name__ == '__main__': |
| 557 main(sys.argv) | 558 main(sys.argv) |
| OLD | NEW |