blob: 832eac03b21d5f922f4104d9c4229d7737aa7291 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.AsynchronousTask import AsynchronousTask
from portage.output import colorize
class PackageMerge(AsynchronousTask):
__slots__ = ("merge",)
def _start(self):
pkg = self.merge.pkg
pkg_count = self.merge.pkg_count
if pkg.installed:
action_desc = "Uninstalling"
preposition = "from"
counter_str = ""
else:
action_desc = "Installing"
preposition = "to"
counter_str = "(%s of %s) " % \
(colorize("MERGE_LIST_PROGRESS", str(pkg_count.curval)),
colorize("MERGE_LIST_PROGRESS", str(pkg_count.maxval)))
msg = "%s %s%s" % \
(action_desc,
counter_str,
colorize("GOOD", pkg.cpv))
if pkg.root != "/":
msg += " %s %s" % (preposition, pkg.root)
if not self.merge.build_opts.fetchonly and \
not self.merge.build_opts.pretend and \
not self.merge.build_opts.buildpkgonly:
self.merge.statusMessage(msg)
self.merge.merge(self.exit_handler)
def exit_handler(self, task):
self.returncode = task.returncode
self.wait()
|