Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185930 - emerge sends wget ouput to stderr
Summary: emerge sends wget ouput to stderr
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 181949 187293
  Show dependency tree
Reported: 2007-07-19 23:06 UTC by Mark J. Olah
Modified: 2007-07-22 22:56 UTC (History)
0 users

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

output of: emerge -quDN > /dev/null (emerge-stderr-output.txt,57.80 KB, text/plain)
2007-07-19 23:09 UTC, Mark J. Olah
direct all FETCHCOMMAND output to stdout (stdout.patch,721 bytes, patch)
2007-07-21 04:22 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark J. Olah 2007-07-19 23:06:23 UTC
For the purposes of cron scripts I use the command:
/usr/bin/emerge -quND world > /dev/null

I would expect this to only leave me with the stderr output (regardless of the presence of the -q flag).  But I routinely get the output from some (not all?) of the wget commands portage executes.  No other extra output is observed.

I would expect that all of the output from wget should be directed to stdout.  Especially when the result of the wget command is successful.

I will attach sample output from the above command when run by cron.

Comment 1 Mark J. Olah 2007-07-19 23:09:22 UTC
Created attachment 125395 [details]
output of: emerge -quDN > /dev/null
Comment 2 Andrew Gaffney (RETIRED) gentoo-dev 2007-07-19 23:13:20 UTC
This isn't a portage bug, per se. wget automatically sends the output to stderr.
Comment 3 Steve L 2007-07-19 23:22:29 UTC
You can try adding the -q option to FETCHCOMMAND and RESUMECOMMAND in make.conf. You can see the current values with portageq:
portageq envvar FETCHCOMMAND
/usr/bin/wget -t 5 -T 60 --passive-ftp -O ${DISTDIR}/${FILE} ${URI}
portageq envvar RESUMECOMMAND
/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O ${DISTDIR}/${FILE} ${URI}

I think this will work if you do:
export FETCHCOMMAND='/usr/bin/wget -q -t 5 -T 60 --passive-ftp -O ${DISTDIR}/${FILE} ${URI}'
export RESUMECOMMAND='/usr/bin/wget -q -c -t 5 -T 60 --passive-ftp -O ${DISTDIR}/${FILE} ${URI}'
/usr/bin/emerge -quND world > /dev/null

Comment 4 Mark J. Olah 2007-07-19 23:28:35 UTC
Thanks for the suggestion Steve L.  I will try that.

However I still believe that this behavior is a bug.  The program is not as useful if extraneous information is being sent to stderr.  I'm sure anyone writing bash scripts to wrap emerge will run into all of this wget output where it shouldn't be.

I noticed in portage_exec.spawn(), the fd_pipes parameter can be used to redirect stderr to stdout for a particular command.  I realize this will of course redirect real wget errors to stdout too, but perhaps portage can send a message to stderr if the wget commmand's return status is an error.

Comment 5 Zac Medico gentoo-dev 2007-07-21 04:22:29 UTC
Created attachment 125529 [details, diff]
direct all FETCHCOMMAND output to stdout

Thanks, this is fixed in svn r7331.
Comment 6 Zac Medico gentoo-dev 2007-07-22 22:56:21 UTC
This has been released in 2.1.3_rc9.