diff options
author | Zac Medico <zmedico@gentoo.org> | 2020-04-07 22:07:25 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2020-04-07 22:29:49 -0700 |
commit | a0700108913e85b359ea7c579147f8f1d7825b9e (patch) | |
tree | d05f70e5c4ec24ee8c7ea5905d3b1192a896a601 /lib/_emerge/EbuildPhase.py | |
parent | Revert "AsynchronousTask: Call _start_hook after _start_async" (diff) | |
download | portage-a0700108913e85b359ea7c579147f8f1d7825b9e.tar.gz portage-a0700108913e85b359ea7c579147f8f1d7825b9e.tar.bz2 portage-a0700108913e85b359ea7c579147f8f1d7825b9e.zip |
Revert "EbuildPhase: add _async_start coroutine"
This reverts commit c7e52d0466211907d20cdbc04f1e90e7da626694.
Bug: https://bugs.gentoo.org/716636
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge/EbuildPhase.py')
-rw-r--r-- | lib/_emerge/EbuildPhase.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py index f6b380e05..477e0ba97 100644 --- a/lib/_emerge/EbuildPhase.py +++ b/lib/_emerge/EbuildPhase.py @@ -23,7 +23,7 @@ from portage.util._dyn_libs.soname_deps_qa import ( ) from portage.package.ebuild.prepare_build_dirs import (_prepare_workdir, _prepare_fake_distdir, _prepare_fake_filesdir) -from portage.util.futures.compat_coroutine import coroutine, coroutine_return +from portage.util.futures.compat_coroutine import coroutine from portage.util import writemsg from portage.util._async.AsyncTaskFuture import AsyncTaskFuture from portage.util.futures.executor.fork import ForkExecutor @@ -69,10 +69,6 @@ class EbuildPhase(CompositeTask): _locked_phases = ("setup", "preinst", "postinst", "prerm", "postrm") def _start(self): - self.scheduler.run_until_complete(self._async_start()) - - @coroutine - def _async_start(self): need_builddir = self.phase not in EbuildProcess._phases_without_builddir @@ -142,17 +138,20 @@ class EbuildPhase(CompositeTask): env_extractor = BinpkgEnvExtractor(background=self.background, scheduler=self.scheduler, settings=self.settings) if env_extractor.saved_env_exists(): - self._current_task = env_extractor - yield env_extractor.async_start() - yield env_extractor.async_wait() - if self._default_exit(env_extractor) != os.EX_OK: - self._async_wait() - coroutine_return() + self._start_task(env_extractor, self._env_extractor_exit) + return # If the environment.bz2 doesn't exist, then ebuild.sh will # source the ebuild as a fallback. self._start_lock() + def _env_extractor_exit(self, env_extractor): + if self._default_exit(env_extractor) != os.EX_OK: + self.wait() + return + + self._start_lock() + def _start_lock(self): if (self.phase in self._locked_phases and "ebuild-locks" in self.settings.features): |