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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 for line in fileinput.input(new_ebuild_path, inplace=1): | 268 for line in fileinput.input(new_ebuild_path, inplace=1): |
269 # Has to be done here to get changes to sys.stdout from fileinput.input. | 269 # Has to be done here to get changes to sys.stdout from fileinput.input. |
270 if not redirect_file: | 270 if not redirect_file: |
271 redirect_file = sys.stdout | 271 redirect_file = sys.stdout |
272 if line.startswith('KEYWORDS'): | 272 if line.startswith('KEYWORDS'): |
273 # Actually mark this file as stable by removing ~'s. | 273 # Actually mark this file as stable by removing ~'s. |
274 redirect_file.write(line.replace("~", "")) | 274 redirect_file.write(line.replace("~", "")) |
275 elif line.startswith('EAPI'): | 275 elif line.startswith('EAPI'): |
276 # Always add new commit_id after EAPI definition. | 276 # Always add new commit_id after EAPI definition. |
277 redirect_file.write(line) | 277 redirect_file.write(line) |
278 redirect_file.write('EGIT_COMMIT="%s"' % commit_id) | 278 redirect_file.write('CROS_WORKON_COMMIT="%s"' % commit_id) |
279 elif not line.startswith('EGIT_COMMIT'): | 279 elif not line.startswith('CROS_WORKON_COMMIT'): |
280 # Skip old EGIT_COMMIT definition. | 280 # Skip old CROS_WORKON_COMMIT definition. |
281 redirect_file.write(line) | 281 redirect_file.write(line) |
282 fileinput.close() | 282 fileinput.close() |
283 | 283 |
284 _Print('Adding new stable ebuild to git') | 284 _Print('Adding new stable ebuild to git') |
285 _RunCommand('git add %s' % new_ebuild_path) | 285 _RunCommand('git add %s' % new_ebuild_path) |
286 | 286 |
287 _Print('Removing old ebuild from git') | 287 _Print('Removing old ebuild from git') |
288 _RunCommand('git rm %s' % self._ebuild.ebuild_path) | 288 _RunCommand('git rm %s' % self._ebuild.ebuild_path) |
289 | 289 |
290 def CommitChange(self, message): | 290 def CommitChange(self, message): |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 'and reset the git repo yourself.' % | 353 'and reset the git repo yourself.' % |
354 (package_list[:index], _CHROMIUMOS_OVERLAYS_DIRECTORY)) | 354 (package_list[:index], _CHROMIUMOS_OVERLAYS_DIRECTORY)) |
355 raise e | 355 raise e |
356 elif command == 'push': | 356 elif command == 'push': |
357 _PushChange() | 357 _PushChange() |
358 | 358 |
359 | 359 |
360 if __name__ == '__main__': | 360 if __name__ == '__main__': |
361 main(sys.argv) | 361 main(sys.argv) |
362 | 362 |
OLD | NEW |