summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/ebuild.sh5
-rw-r--r--pym/_emerge/EbuildPhase.py26
2 files changed, 26 insertions, 5 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 6627c898d..5808c8e8f 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -2214,11 +2214,6 @@ ebuild_main() {
export SANDBOX_ON="0"
;;
help|pretend|setup|preinst)
- if [[ $EBUILD_SH_ARGS = setup ]] ; then
- einfo "CPV: $CATEGORY/$PF"
- einfo "REPO: $PORTAGE_REPO_NAME"
- einfo "USE: $USE"
- fi
#pkg_setup needs to be out of the sandbox for tmp file creation;
#for example, awking and piping a file in /tmp requires a temp file to be created
#in /etc. If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index e85fe9c13..a5d617f65 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -11,12 +11,14 @@ from _emerge.CompositeTask import CompositeTask
from portage.util import writemsg
import portage
portage.proxy.lazyimport.lazyimport(globals(),
+ 'portage.elog:messages@elog_messages',
'portage.package.ebuild.doebuild:_check_build_log,' + \
'_post_phase_cmds,_post_phase_userpriv_perms,' + \
'_post_src_install_chost_fix,' + \
'_post_src_install_uid_fix'
)
from portage import os
+from portage import StringIO
from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
@@ -27,6 +29,18 @@ class EbuildPhase(CompositeTask):
def _start(self):
+ if self.phase == 'setup':
+
+ use = self.settings.get('PORTAGE_BUILT_USE')
+ if use is None:
+ use = self.settings['PORTAGE_USE']
+
+ msg = []
+ msg.append("CPV: %s" % self.settings.mycpv)
+ msg.append("REPO: %s" % self.settings['PORTAGE_REPO_NAME'])
+ msg.append("USE: %s" % use)
+ self._elog('einfo', msg)
+
if self.phase == 'prerm':
env_extractor = BinpkgEnvExtractor(background=self.background,
scheduler=self.scheduler, settings=self.settings)
@@ -200,3 +214,15 @@ class EbuildPhase(CompositeTask):
self._final_exit(clean_phase)
self.returncode = 1
self.wait()
+
+ def _elog(self, elog_funcname, lines):
+ out = StringIO()
+ phase = self.phase
+ elog_func = getattr(elog_messages, elog_funcname)
+ for line in lines:
+ elog_func(line, phase=phase, key=self.settings.mycpv, out=out)
+ msg = _unicode_decode(out.getvalue(),
+ encoding=_encodings['content'], errors='replace')
+ if msg:
+ self.scheduler.output(msg,
+ log_path=self.settings.get("PORTAGE_LOG_FILE"))