summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/AbstractEbuildProcess.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-13 22:49:03 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-13 22:49:03 -0700
commitac0965588410cb437efff2a240256e2c0a5bfd7b (patch)
tree0e4eda7304871ab311b7678db6cf627a2133acbd /pym/_emerge/AbstractEbuildProcess.py
parentaef1da0fb734ff691b191a91c4c66fe95e11ab3b (diff)
downloadportage-ac0965588410cb437efff2a240256e2c0a5bfd7b.tar.gz
portage-ac0965588410cb437efff2a240256e2c0a5bfd7b.tar.bz2
portage-ac0965588410cb437efff2a240256e2c0a5bfd7b.zip
Make AbstractEbuildProcess lock PORTAGE_BUILDIR if it's not already
locked.
Diffstat (limited to 'pym/_emerge/AbstractEbuildProcess.py')
-rw-r--r--pym/_emerge/AbstractEbuildProcess.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index ed20b14f9..7169dab58 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -4,6 +4,7 @@
import stat
import textwrap
from _emerge.SpawnProcess import SpawnProcess
+from _emerge.EbuildBuildDir import EbuildBuildDir
from _emerge.EbuildIpcDaemon import EbuildIpcDaemon
import portage
from portage.elog import messages as elog_messages
@@ -20,7 +21,7 @@ from portage.util import apply_secpass_permissions
class AbstractEbuildProcess(SpawnProcess):
__slots__ = ('phase', 'settings',) + \
- ('_ipc_daemon', '_exit_command',)
+ ('_build_dir', '_ipc_daemon', '_exit_command',)
_phases_without_builddir = ('clean', 'cleanrm', 'depend', 'help',)
# Number of milliseconds to allow natural exit of the ebuild
@@ -67,6 +68,11 @@ class AbstractEbuildProcess(SpawnProcess):
if self._enable_ipc_daemon:
self.settings.pop('PORTAGE_EBUILD_EXIT_FILE', None)
if self.phase not in self._phases_without_builddir:
+ if 'PORTAGE_BUILDIR_LOCKED' not in self.settings:
+ self._build_dir = EbuildBuildDir(
+ dir_path=self.settings['PORTAGE_BUILDDIR'],
+ scheduler=self.scheduler, settings=self.settings)
+ self._build_dir.lock()
self.settings['PORTAGE_IPC_DAEMON'] = "1"
self._start_ipc_daemon()
else:
@@ -230,6 +236,9 @@ class AbstractEbuildProcess(SpawnProcess):
else:
self.returncode = 1
self._unexpected_exit()
+ if self._build_dir is not None:
+ self._build_dir.unlock()
+ self._build_dir = None
else:
exit_file = self.settings.get('PORTAGE_EBUILD_EXIT_FILE')
if exit_file and not os.path.exists(exit_file):