From 1f0452f69e03b728ae26f6e5800fe52dbd0cd649 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 6 Jul 2008 15:17:10 +0000 Subject: [PATCH] Add a PackageMerge class to serve as an asynchronous interface to package merges. For now it executes synchronously inside the start() method. svn path=/main/trunk/; revision=10961 --- pym/_emerge/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index f1316e92b..ca69164b5 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2893,6 +2893,18 @@ class MergeListItem(CompositeTask): retval = self._install_task.install() return retval +class PackageMerge(CompositeTask): + """ + TODO: Implement asynchronous merge so that the scheduler can + run while a merge is executing. + """ + + __slots__ = ("merge",) + + def start(self): + self.returncode = self.merge.merge() + self.wait() + class DependencyArg(object): def __init__(self, arg=None, root_config=None): self.arg = arg @@ -7850,7 +7862,9 @@ class Scheduler(object): retval = task.wait() if retval == os.EX_OK: - retval = task.merge() + task = PackageMerge(merge=task) + task.start() + retval = task.wait() if retval == os.EX_OK: self.curval += 1 -- 2.26.2