Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 217444

Summary: debug-print() problem with stdout
Product: Portage Development Reporter: Fabio Rossi <rossi.f>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 216231    
Attachments: ebuild.sh.patch

Description Fabio Rossi 2008-04-12 18:50:24 UTC
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.
Comment 1 Fabio Rossi 2008-04-12 18:50:56 UTC
Created attachment 149494 [details, diff]
ebuild.sh.patch
Comment 2 Zac Medico gentoo-dev 2008-04-13 04:33:18 UTC
Thanks, this is fixed in 2.1.5_rc3.