The user envvar ECLASS_DEBUG_OUTPUT=on is used to redirect the debug-print() output also to the standard output thanks to the echo command. What happens if a function calls debug-print() and then returns a string value? Here is a code snippet: <<< cut here >>> function() { debug-print-function ${FUNCNAME} $* ... echo $result } str="String construction thanks to $(function)" <<< cut here >>> In this case the debug output is mixed with the real result of the function. I'm proposing a simple patch to solve the problem redirecting the offending debug-print() output to the standard error.
Created attachment 149494 [details, diff] ebuild.sh.patch
Thanks, this is fixed in 2.1.5_rc3.