| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 self.ebuild_path = self._FindEBuildPath(package) | 204 self.ebuild_path = self._FindEBuildPath(package) |
| 205 (self.ebuild_path_no_revision, | 205 (self.ebuild_path_no_revision, |
| 206 self.ebuild_path_no_version, | 206 self.ebuild_path_no_version, |
| 207 self.current_revision) = self._ParseEBuildPath(self.ebuild_path) | 207 self.current_revision) = self._ParseEBuildPath(self.ebuild_path) |
| 208 self.commit_id = commit_id | 208 self.commit_id = commit_id |
| 209 | 209 |
| 210 @classmethod | 210 @classmethod |
| 211 def _FindEBuildPath(cls, package): | 211 def _FindEBuildPath(cls, package): |
| 212 """Static method that returns the full path of an ebuild.""" | 212 """Static method that returns the full path of an ebuild.""" |
| 213 _Print('Looking for unstable ebuild for %s' % package) | 213 _Print('Looking for unstable ebuild for %s' % package) |
| 214 equery_cmd = 'equery-%s which %s 2> /dev/null' \ | 214 equery_cmd = ( |
| 215 % (gflags.FLAGS.board, package) | 215 'ACCEPT_KEYWORDS="x86 arm amd64" equery-%s which %s 2> /dev/null' |
| 216 % (gflags.FLAGS.board, package)) |
| 216 path = _SimpleRunCommand(equery_cmd) | 217 path = _SimpleRunCommand(equery_cmd) |
| 217 if path: | 218 if path: |
| 218 _Print('Unstable ebuild found at %s' % path) | 219 _Print('Unstable ebuild found at %s' % path) |
| 219 return path | 220 return path |
| 220 | 221 |
| 221 @classmethod | 222 @classmethod |
| 222 def _ParseEBuildPath(cls, ebuild_path): | 223 def _ParseEBuildPath(cls, ebuild_path): |
| 223 """Static method that parses the path of an ebuild | 224 """Static method that parses the path of an ebuild |
| 224 | 225 |
| 225 Returns a tuple containing the (ebuild path without the revision | 226 Returns a tuple containing the (ebuild path without the revision |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 'and reset the git repo yourself.' % | 369 'and reset the git repo yourself.' % |
| 369 (package_list[:index], overlay_directory)) | 370 (package_list[:index], overlay_directory)) |
| 370 raise e | 371 raise e |
| 371 elif command == 'push': | 372 elif command == 'push': |
| 372 _PushChange() | 373 _PushChange() |
| 373 | 374 |
| 374 | 375 |
| 375 if __name__ == '__main__': | 376 if __name__ == '__main__': |
| 376 main(sys.argv) | 377 main(sys.argv) |
| 377 | 378 |
| OLD | NEW |