commit:     0dfa50e1d85aea0d63497fb823139541bc989e2e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 21 07:49:00 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 18:30:53 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0dfa50e1

EbuildBuild: use async_lock (bug 614112)

Asynchronously lock the build directory, and use AsyncTaskFuture
to fit the resulting future into the CompositeTask framework that
EbuildBuild uses.

Bug: https://bugs.gentoo.org/614112

 pym/_emerge/EbuildBuild.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index f1a2103a3..9d4afd0ea 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -150,8 +150,13 @@ class EbuildBuild(CompositeTask):
 
                self._build_dir = EbuildBuildDir(
                        scheduler=self.scheduler, settings=settings)
-               self._build_dir.lock()
+               self._start_task(
+                       AsyncTaskFuture(future=self._build_dir.async_lock()),
+                       self._start_pre_clean)
 
+       def _start_pre_clean(self, lock_task):
+               self._assert_current(lock_task)
+               lock_task.future.result()
                # Cleaning needs to happen before fetch, since the build dir
                # is used for log handling.
                msg = " === (%s of %s) Cleaning (%s::%s)" % \

Reply via email to