blob: 67553ddf89208f8bd706d2c16269aa19d94fcb95 (
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
43
44
45
46
|
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
from _emerge.AsynchronousTask import AsynchronousTask
from portage.output import colorize
class PackageMerge(AsynchronousTask):
"""
TODO: Implement asynchronous merge so that the scheduler can
run while a merge is executing.
"""
__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.returncode = self.merge.merge()
self.wait()
|