subclasses and into AbstractEbuildProcess itself.
from _emerge.SpawnProcess import SpawnProcess
import portage
+portage.proxy.lazyimport.lazyimport(globals(),
+ 'portage.package.ebuild.doebuild:_doebuild_exit_status_check_and_log'
+)
from portage import os
from portage.util._pty import _create_pty_or_pipe
class AbstractEbuildProcess(SpawnProcess):
__slots__ = ('settings',)
+ _phases_without_builddir = ('clean', 'cleanrm', 'depend', 'help',)
def _pipe(self, fd_pipes):
stdout_pipe = fd_pipes.get(1)
# See Bug #162404.
return not ('sesandbox' in self.settings.features \
and self.settings.selinux_enabled()) or os.isatty(slave_fd)
+
+ def _set_returncode(self, wait_retval):
+ SpawnProcess._set_returncode(self, wait_retval)
+ phase = self.settings.get("EBUILD_PHASE")
+ if not phase:
+ phase = 'other'
+ if phase not in self._phases_without_builddir:
+ self.returncode = _doebuild_exit_status_check_and_log(
+ self.settings, phase, self.returncode)
from _emerge.AbstractEbuildProcess import AbstractEbuildProcess
from portage import os
from portage.package.ebuild.doebuild import doebuild, \
- _doebuild_exit_status_check_and_log, _post_phase_userpriv_perms
+ _post_phase_userpriv_perms
class EbuildProcess(AbstractEbuildProcess):
def _set_returncode(self, wait_retval):
AbstractEbuildProcess._set_returncode(self, wait_retval)
- if self.phase not in ("clean", "cleanrm"):
- self.returncode = _doebuild_exit_status_check_and_log(
- self.settings, self.phase, self.returncode)
-
if self.phase == "test" and self.returncode != os.EX_OK and \
"test-fail-continue" in self.settings.features:
self.returncode = os.EX_OK
from _emerge.AbstractEbuildProcess import AbstractEbuildProcess
import portage
from portage import os
-portage.proxy.lazyimport.lazyimport(globals(),
- 'portage.package.ebuild.doebuild:_doebuild_exit_status_check_and_log'
-)
class EbuildSpawnProcess(AbstractEbuildProcess):
"""
- Spawns misc-functions.sh with an existing ebuild environment.
+ Used by doebuild.spawn() to manage the spawned process.
"""
_spawn_kwarg_names = AbstractEbuildProcess._spawn_kwarg_names + \
('fakeroot_state',)
__slots__ = ('fakeroot_state', 'spawn_func')
- def _start(self):
-
- AbstractEbuildProcess._start(self)
-
def _spawn(self, args, **kwargs):
return self.spawn_func(args, **kwargs)
-
- def _set_returncode(self, wait_retval):
- AbstractEbuildProcess._set_returncode(self, wait_retval)
- phase = self.settings.get("EBUILD_PHASE")
- if not phase:
- phase = 'other'
- self.returncode = _doebuild_exit_status_check_and_log(
- self.settings, phase, self.returncode)
from _emerge.AbstractEbuildProcess import AbstractEbuildProcess
import portage
from portage import os
-from portage.package.ebuild.doebuild import spawn, \
- _doebuild_exit_status_check_and_log
+from portage.package.ebuild.doebuild import spawn
class MiscFunctionsProcess(AbstractEbuildProcess):
"""
debug = settings.get("PORTAGE_DEBUG") == "1"
return spawn(" ".join(args), settings,
debug=debug, **kwargs)
-
- def _set_returncode(self, wait_retval):
- AbstractEbuildProcess._set_returncode(self, wait_retval)
- self.returncode = _doebuild_exit_status_check_and_log(
- self.settings, self.phase, self.returncode)
-
mysettings["PORTAGE_SANDBOX_T"])
phase = env.get('EBUILD_PHASE')
- if phase not in ('clean', 'cleanrm', 'depend', 'help',):
+ if phase not in EbuildSpawnProcess._phases_without_builddir:
# Don't try to unlink for phases that don't require
# PORTAGE_BUILDDIR, since the directory may not
# even belong to this process in that case.