aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/EbuildBuildDir.py46
1 files changed, 16 insertions, 30 deletions
diff --git a/lib/_emerge/EbuildBuildDir.py b/lib/_emerge/EbuildBuildDir.py
index f1c49f041..77dbff1fb 100644
--- a/lib/_emerge/EbuildBuildDir.py
+++ b/lib/_emerge/EbuildBuildDir.py
@@ -6,7 +6,6 @@ from _emerge.AsynchronousLock import AsynchronousLock
import portage
from portage import os
from portage.exception import PortageException
-from portage.util.futures import asyncio
from portage.util.futures.compat_coroutine import coroutine
from portage.util.SlotObject import SlotObject
@@ -70,29 +69,22 @@ class EbuildBuildDir(SlotObject):
raise
catdir_lock = AsynchronousLock(path=catdir, scheduler=self.scheduler)
- builddir_lock = AsynchronousLock(path=dir_path, scheduler=self.scheduler)
- try:
- yield catdir_lock.async_start()
- yield catdir_lock.async_wait()
+ yield catdir_lock.async_start()
+ yield catdir_lock.async_wait()
- self._assert_lock(catdir_lock)
+ self._assert_lock(catdir_lock)
- try:
- portage.util.ensure_dirs(catdir,
- gid=portage.portage_gid,
- mode=0o70, mask=0)
- except PortageException:
- if not os.path.isdir(catdir):
- raise
-
- yield builddir_lock.async_start()
- yield builddir_lock.async_wait()
- except asyncio.CancelledError:
- if catdir_lock.poll() is None:
- catdir_lock.cancel()
- if builddir_lock.poll() is None:
- builddir_lock.cancel()
- raise
+ try:
+ portage.util.ensure_dirs(catdir,
+ gid=portage.portage_gid,
+ mode=0o70, mask=0)
+ except PortageException:
+ if not os.path.isdir(catdir):
+ raise
+
+ builddir_lock = AsynchronousLock(path=dir_path, scheduler=self.scheduler)
+ yield builddir_lock.async_start()
+ yield builddir_lock.async_wait()
try:
self._assert_lock(builddir_lock)
@@ -121,14 +113,8 @@ class EbuildBuildDir(SlotObject):
self.settings.pop('PORTAGE_BUILDDIR_LOCKED', None)
catdir_lock = AsynchronousLock(
path=self._catdir, scheduler=self.scheduler)
- try:
- yield catdir_lock.async_start()
- yield catdir_lock.async_wait()
- except asyncio.CancelledError:
- if catdir_lock.poll() is None:
- catdir_lock.cancel()
- raise
-
+ yield catdir_lock.async_start()
+ yield catdir_lock.async_wait()
if catdir_lock.returncode == os.EX_OK:
try:
os.rmdir(self._catdir)