| OLD | NEW |
| 1 # Copyright 1999-2009 Gentoo Foundation | 1 # Copyright 1999-2009 Gentoo Foundation |
| 2 # Distributed under the terms of the GNU General Public License v2 | 2 # Distributed under the terms of the GNU General Public License v2 |
| 3 | 3 |
| 4 from _emerge.AsynchronousTask import AsynchronousTask | 4 from _emerge.AsynchronousTask import AsynchronousTask |
| 5 from portage.output import colorize | 5 from portage.output import colorize |
| 6 class PackageMerge(AsynchronousTask): | 6 class PackageMerge(AsynchronousTask): |
| 7 """ | |
| 8 TODO: Implement asynchronous merge so that the scheduler can | |
| 9 run while a merge is executing. | |
| 10 """ | |
| 11 | |
| 12 __slots__ = ("merge",) | 7 __slots__ = ("merge",) |
| 13 | 8 |
| 14 def _start(self): | 9 def _start(self): |
| 15 | 10 |
| 16 pkg = self.merge.pkg | 11 pkg = self.merge.pkg |
| 17 pkg_count = self.merge.pkg_count | 12 pkg_count = self.merge.pkg_count |
| 18 | 13 |
| 19 if pkg.installed: | 14 if pkg.installed: |
| 20 action_desc = "Uninstalling" | 15 action_desc = "Uninstalling" |
| 21 preposition = "from" | 16 preposition = "from" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 33 colorize("GOOD", pkg.cpv)) | 28 colorize("GOOD", pkg.cpv)) |
| 34 | 29 |
| 35 if pkg.root != "/": | 30 if pkg.root != "/": |
| 36 msg += " %s %s" % (preposition, pkg.root) | 31 msg += " %s %s" % (preposition, pkg.root) |
| 37 | 32 |
| 38 if not self.merge.build_opts.fetchonly and \ | 33 if not self.merge.build_opts.fetchonly and \ |
| 39 not self.merge.build_opts.pretend and \ | 34 not self.merge.build_opts.pretend and \ |
| 40 not self.merge.build_opts.buildpkgonly: | 35 not self.merge.build_opts.buildpkgonly: |
| 41 self.merge.statusMessage(msg) | 36 self.merge.statusMessage(msg) |
| 42 | 37 |
| 43 » » self.returncode = self.merge.merge() | 38 » » self.merge.merge(self.exit_handler) |
| 44 » » self.wait() | |
| 45 | 39 |
| 40 def exit_handler(self, task): |
| 41 self.returncode = task.returncode |
| 42 self._wait_hook() |
| 43 |
| OLD | NEW |