Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 217444 - debug-print() problem with stdout
Summary: debug-print() problem with stdout
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 216231
  Show dependency tree
 
Reported: 2008-04-12 18:50 UTC by Fabio Rossi
Modified: 2008-04-13 04:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild.sh.patch (ebuild.sh.patch,354 bytes, patch)
2008-04-12 18:50 UTC, Fabio Rossi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.