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.
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
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)
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"))