Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 655996 | Differences between
and this patch

Collapse All | Expand All

(-)a/pym/_emerge/EbuildPhase.py (-1 / +29 lines)
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)
(-)a/pym/_emerge/MiscFunctionsProcess.py (-1 / +5 lines)
Lines 13-19 class MiscFunctionsProcess(AbstractEbuildProcess): Link Here
13
	Spawns misc-functions.sh with an existing ebuild environment.
13
	Spawns misc-functions.sh with an existing ebuild environment.
14
	"""
14
	"""
15
15
16
	__slots__ = ('commands',)
16
	__slots__ = ('commands', 'ld_preload_sandbox')
17
17
18
	def _start(self):
18
	def _start(self):
19
		settings = self.settings
19
		settings = self.settings
Lines 29-34 class MiscFunctionsProcess(AbstractEbuildProcess): Link Here
29
		AbstractEbuildProcess._start(self)
29
		AbstractEbuildProcess._start(self)
30
30
31
	def _spawn(self, args, **kwargs):
31
	def _spawn(self, args, **kwargs):
32
		# If self.ld_preload_sandbox is None, default to free=False,
33
		# in alignment with the spawn(free=False) default.
34
		kwargs.setdefault('free', False if self.ld_preload_sandbox is None
35
			else not self.ld_preload_sandbox)
32
36
33
		if self._dummy_pipe_fd is not None:
37
		if self._dummy_pipe_fd is not None:
34
			self.settings["PORTAGE_PIPE_FD"] = str(self._dummy_pipe_fd)
38
			self.settings["PORTAGE_PIPE_FD"] = str(self._dummy_pipe_fd)
(-)a/pym/portage/package/ebuild/doebuild.py (-8 / +21 lines)
Lines 1722-1734 _post_phase_cmds = { Link Here
1722
		"install_symlink_html_docs",
1722
		"install_symlink_html_docs",
1723
		"install_hooks"],
1723
		"install_hooks"],
1724
1724
1725
	"preinst" : [
1725
	"preinst" : (
1726
		"preinst_sfperms",
1726
		(
1727
		"preinst_selinux_labels",
1727
			# Since SELinux does not allow LD_PRELOAD across domain transitions,
1728
		"preinst_suid_scan",
1728
			# disable the LD_PRELOAD sandbox for preinst_selinux_labels.
1729
		"preinst_qa_check",
1729
			{
1730
		],
1730
				"ld_preload_sandbox": False,
1731
1731
				"selinux_only": True,
1732
			},
1733
			[
1734
				"preinst_selinux_labels",
1735
			],
1736
		),
1737
		(
1738
			{},
1739
			[
1740
				"preinst_sfperms",
1741
				"preinst_suid_scan",
1742
				"preinst_qa_check",
1743
			],
1744
		),
1745
	),
1732
	"postinst" : [
1746
	"postinst" : [
1733
		"postinst_qa_check"],
1747
		"postinst_qa_check"],
1734
}
1748
}
1735
- 

Return to bug 655996