summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/vartree.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 5e00f7fd7..fe3262655 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2759,6 +2759,20 @@ class dblink(object):
self._scheduler.dblinkElog(self,
phase, _eerror, lines)
+ def _elog_subprocess(self, funcname, phase, lines):
+ """
+ Subprocesses call this in order to create elog messages in
+ $T, for collection by the main process.
+ """
+ cmd = "source %s/isolated-functions.sh ; " % \
+ portage._shell_quote(self.settings["PORTAGE_BIN_PATH"])
+ for line in lines:
+ cmd += "%s %s ; " % (funcname, portage._shell_quote(line))
+ env = self.settings.environ()
+ env['EBUILD_PHASE'] = phase
+ subprocess.call([portage.const.BASH_BINARY, "-c", cmd],
+ env=env)
+
def treewalk(self, srcroot, destroot, inforoot, myebuild, cleanup=0,
mydbapi=None, prev_mtimes=None):
"""
@@ -3628,7 +3642,7 @@ class dblink(object):
msg.append(_("This file will be renamed to a different name:"))
msg.append(" '%s'" % backup_dest)
msg.append("")
- self._eerror("preinst", msg)
+ self._elog_subprocess("eerror", "preinst", msg)
if movefile(mydest, backup_dest,
mysettings=self.settings,
encoding=_encodings['merge']) is None:
@@ -3706,7 +3720,7 @@ class dblink(object):
msg.append(_("This file will be merged with a different name:"))
msg.append(" '%s'" % newdest)
msg.append("")
- self._eerror("preinst", msg)
+ self._elog_subprocess("eerror", "preinst", msg)
mydest = newdest
elif stat.S_ISREG(mydmode) or (stat.S_ISLNK(mydmode) and os.path.exists(mydest) and stat.S_ISREG(os.stat(mydest)[stat.ST_MODE])):