Lines 13-18
from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
Link Here
|
13 |
from _emerge.EbuildProcess import EbuildProcess |
13 |
from _emerge.EbuildProcess import EbuildProcess |
14 |
from _emerge.CompositeTask import CompositeTask |
14 |
from _emerge.CompositeTask import CompositeTask |
15 |
from _emerge.PackagePhase import PackagePhase |
15 |
from _emerge.PackagePhase import PackagePhase |
|
|
16 |
from _emerge.TaskSequence import TaskSequence |
16 |
from portage.package.ebuild.prepare_build_dirs import (_prepare_workdir, |
17 |
from portage.package.ebuild.prepare_build_dirs import (_prepare_workdir, |
17 |
_prepare_fake_distdir, _prepare_fake_filesdir) |
18 |
_prepare_fake_distdir, _prepare_fake_filesdir) |
18 |
from portage.util import writemsg |
19 |
from portage.util import writemsg |
Lines 275-281
class EbuildPhase(CompositeTask):
Link Here
|
275 |
# when FEATURES=compress-build-logs is enabled. |
276 |
# when FEATURES=compress-build-logs is enabled. |
276 |
fd, logfile = tempfile.mkstemp() |
277 |
fd, logfile = tempfile.mkstemp() |
277 |
os.close(fd) |
278 |
os.close(fd) |
278 |
post_phase = MiscFunctionsProcess(background=self.background, |
279 |
post_phase = _PostPhaseCommands(background=self.background, |
279 |
commands=post_phase_cmds, fd_pipes=self.fd_pipes, |
280 |
commands=post_phase_cmds, fd_pipes=self.fd_pipes, |
280 |
logfile=logfile, phase=self.phase, scheduler=self.scheduler, |
281 |
logfile=logfile, phase=self.phase, scheduler=self.scheduler, |
281 |
settings=settings) |
282 |
settings=settings) |
Lines 405-407
class EbuildPhase(CompositeTask):
Link Here
|
405 |
log_path = self.settings.get("PORTAGE_LOG_FILE") |
406 |
log_path = self.settings.get("PORTAGE_LOG_FILE") |
406 |
self.scheduler.output(msg, log_path=log_path, |
407 |
self.scheduler.output(msg, log_path=log_path, |
407 |
background=background) |
408 |
background=background) |
|
|
409 |
|
410 |
|
411 |
class _PostPhaseCommands(CompositeTask): |
412 |
|
413 |
__slots__ = ("commands", "fd_pipes", "logfile", "phase", "settings") |
414 |
|
415 |
def _start(self): |
416 |
if isinstance(self.commands, list): |
417 |
cmds = [({}, self.commands)] |
418 |
else: |
419 |
cmds = list(self.commands) |
420 |
|
421 |
if 'selinux' not in self.settings.features: |
422 |
cmds = [(kwargs, commands) for kwargs, commands in |
423 |
cmds if not kwargs.get('selinux_only')] |
424 |
|
425 |
tasks = TaskSequence() |
426 |
for kwargs, commands in cmds: |
427 |
# Select args intended for MiscFunctionsProcess. |
428 |
kwargs = dict((k, v) for k, v in kwargs.items() |
429 |
if k in ('ld_preload_sandbox',)) |
430 |
tasks.add(MiscFunctionsProcess(background=self.background, |
431 |
commands=commands, fd_pipes=self.fd_pipes, |
432 |
logfile=self.logfile, phase=self.phase, |
433 |
scheduler=self.scheduler, settings=self.settings, **kwargs)) |
434 |
|
435 |
self._start_task(tasks, self._default_final_exit) |