Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: cros_mark_as_stable.py

Issue 4062004: Remove env logic from cros_mark_as. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 """Verbose print function.""" 63 """Verbose print function."""
64 if gflags.FLAGS.verbose: 64 if gflags.FLAGS.verbose:
65 Info(message) 65 Info(message)
66 66
67 67
68 def _CleanStalePackages(board, package_array): 68 def _CleanStalePackages(board, package_array):
69 """Cleans up stale package info from a previous build.""" 69 """Cleans up stale package info from a previous build."""
70 Info('Cleaning up stale packages %s.' % package_array) 70 Info('Cleaning up stale packages %s.' % package_array)
71 unmerge_board_cmd = ['emerge-%s' % board, '--unmerge'] 71 unmerge_board_cmd = ['emerge-%s' % board, '--unmerge']
72 unmerge_board_cmd.extend(package_array) 72 unmerge_board_cmd.extend(package_array)
73 RunCommand(unmerge_board_cmd, env=env) 73 RunCommand(unmerge_board_cmd)
74 74
75 unmerge_host_cmd = ['sudo', 'emerge', '--unmerge'] 75 unmerge_host_cmd = ['sudo', 'emerge', '--unmerge']
76 unmerge_host_cmd.extend(package_array) 76 unmerge_host_cmd.extend(package_array)
77 RunCommand(unmerge_host_cmd, env=env) 77 RunCommand(unmerge_host_cmd)
78 78
79 RunCommand(['eclean-%s' % board, '-d', 'packages'], redirect_stderr=True) 79 RunCommand(['eclean-%s' % board, '-d', 'packages'], redirect_stderr=True)
80 RunCommand(['sudo', 'eclean', '-d', 'packages'], redirect_stderr=True) 80 RunCommand(['sudo', 'eclean', '-d', 'packages'], redirect_stderr=True)
81 81
82 82
83 def _BestEBuild(ebuilds): 83 def _BestEBuild(ebuilds):
84 """Returns the newest EBuild from a list of EBuild objects.""" 84 """Returns the newest EBuild from a list of EBuild objects."""
85 from portage.versions import vercmp 85 from portage.versions import vercmp
86 winner = ebuilds[0] 86 winner = ebuilds[0]
87 for ebuild in ebuilds[1:]: 87 for ebuild in ebuilds[1:]:
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 raise 520 raise
521 521
522 if revved_packages: 522 if revved_packages:
523 _CleanStalePackages(gflags.FLAGS.board, revved_packages) 523 _CleanStalePackages(gflags.FLAGS.board, revved_packages)
524 else: 524 else:
525 work_branch.Delete() 525 work_branch.Delete()
526 526
527 527
528 if __name__ == '__main__': 528 if __name__ == '__main__':
529 main(sys.argv) 529 main(sys.argv)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698