| 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 |
| 11 import gflags | 11 import gflags |
| 12 import os | 12 import os |
| 13 import re | 13 import re |
| 14 import shutil | 14 import shutil |
| 15 import subprocess | 15 import subprocess |
| 16 import sys | 16 import sys |
| 17 | 17 |
| 18 sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) | 18 sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) |
| 19 from cros_build_lib import Info, RunCommand, Warning, Die | 19 from cros_build_lib import Info, RunCommand, Warning, Die |
| 20 | 20 |
| 21 gflags.DEFINE_boolean('all', False, | 21 gflags.DEFINE_boolean('all', False, |
| 22 'Mark all packages as stable.') | 22 'Mark all packages as stable.') |
| 23 gflags.DEFINE_string('board', '', | 23 gflags.DEFINE_string('board', '', |
| 24 'Board for which the package belongs.', short_name='b') | 24 'Board for which the package belongs.', short_name='b') |
| 25 gflags.DEFINE_string('drop_file', None, |
| 26 'File to list packages that were revved.') |
| 25 gflags.DEFINE_boolean('dryrun', False, | 27 gflags.DEFINE_boolean('dryrun', False, |
| 26 'Passes dry-run to git push if pushing a change.') | 28 'Passes dry-run to git push if pushing a change.') |
| 27 gflags.DEFINE_string('overlays', '', | 29 gflags.DEFINE_string('overlays', '', |
| 28 'Colon-separated list of overlays to modify.', | 30 'Colon-separated list of overlays to modify.', |
| 29 short_name='o') | 31 short_name='o') |
| 30 gflags.DEFINE_string('packages', '', | 32 gflags.DEFINE_string('packages', '', |
| 31 'Colon-separated list of packages to mark as stable.', | 33 'Colon-separated list of packages to mark as stable.', |
| 32 short_name='p') | 34 short_name='p') |
| 33 gflags.DEFINE_string('push_options', '', | 35 gflags.DEFINE_string('push_options', '', |
| 34 'Options to use with git-cl push using push command.') | 36 'Options to use with git-cl push using push command.') |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 revved_packages.append(ebuild.package) | 564 revved_packages.append(ebuild.package) |
| 563 | 565 |
| 564 except (OSError, IOError): | 566 except (OSError, IOError): |
| 565 Warning('Cannot rev %s\n' % ebuild.package, | 567 Warning('Cannot rev %s\n' % ebuild.package, |
| 566 'Note you will have to go into %s ' | 568 'Note you will have to go into %s ' |
| 567 'and reset the git repo yourself.' % overlay) | 569 'and reset the git repo yourself.' % overlay) |
| 568 raise | 570 raise |
| 569 | 571 |
| 570 if revved_packages: | 572 if revved_packages: |
| 571 _CleanStalePackages(gflags.FLAGS.board, revved_packages) | 573 _CleanStalePackages(gflags.FLAGS.board, revved_packages) |
| 574 if gflags.FLAGS.drop_file: |
| 575 fh = open(gflags.FLAGS.drop_file, 'w') |
| 576 fh.write(' '.join(revved_packages)) |
| 577 fh.close() |
| 572 else: | 578 else: |
| 573 work_branch.Delete() | 579 work_branch.Delete() |
| 574 | 580 |
| 575 | 581 |
| 576 if __name__ == '__main__': | 582 if __name__ == '__main__': |
| 577 main(sys.argv) | 583 main(sys.argv) |
| OLD | NEW |