| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 for line in fileinput.input(new_ebuild_path, inplace=1): | 275 for line in fileinput.input(new_ebuild_path, inplace=1): |
| 276 # Has to be done here to get changes to sys.stdout from fileinput.input. | 276 # Has to be done here to get changes to sys.stdout from fileinput.input. |
| 277 if not redirect_file: | 277 if not redirect_file: |
| 278 redirect_file = sys.stdout | 278 redirect_file = sys.stdout |
| 279 if line.startswith('KEYWORDS'): | 279 if line.startswith('KEYWORDS'): |
| 280 # Actually mark this file as stable by removing ~'s. | 280 # Actually mark this file as stable by removing ~'s. |
| 281 redirect_file.write(line.replace("~", "")) | 281 redirect_file.write(line.replace("~", "")) |
| 282 elif line.startswith('EAPI'): | 282 elif line.startswith('EAPI'): |
| 283 # Always add new commit_id after EAPI definition. | 283 # Always add new commit_id after EAPI definition. |
| 284 redirect_file.write(line) | 284 redirect_file.write(line) |
| 285 redirect_file.write('CROS_WORKON_COMMIT="%s"' % commit_id) | 285 redirect_file.write('CROS_WORKON_COMMIT="%s"\n' % commit_id) |
| 286 elif not line.startswith('CROS_WORKON_COMMIT'): | 286 elif not line.startswith('CROS_WORKON_COMMIT'): |
| 287 # Skip old CROS_WORKON_COMMIT definition. | 287 # Skip old CROS_WORKON_COMMIT definition. |
| 288 redirect_file.write(line) | 288 redirect_file.write(line) |
| 289 fileinput.close() | 289 fileinput.close() |
| 290 | 290 |
| 291 _Print('Adding new stable ebuild to git') | 291 _Print('Adding new stable ebuild to git') |
| 292 _RunCommand('git add %s' % new_ebuild_path) | 292 _RunCommand('git add %s' % new_ebuild_path) |
| 293 | 293 |
| 294 _Print('Removing old ebuild from git') | 294 _Print('Removing old ebuild from git') |
| 295 _RunCommand('git rm %s' % self._ebuild.ebuild_path) | 295 _RunCommand('git rm %s' % self._ebuild.ebuild_path) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 'and reset the git repo yourself.' % | 360 'and reset the git repo yourself.' % |
| 361 (package_list[:index], _CHROMIUMOS_OVERLAYS_DIRECTORY)) | 361 (package_list[:index], _CHROMIUMOS_OVERLAYS_DIRECTORY)) |
| 362 raise e | 362 raise e |
| 363 elif command == 'push': | 363 elif command == 'push': |
| 364 _PushChange() | 364 _PushChange() |
| 365 | 365 |
| 366 | 366 |
| 367 if __name__ == '__main__': | 367 if __name__ == '__main__': |
| 368 main(sys.argv) | 368 main(sys.argv) |
| 369 | 369 |
| OLD | NEW |