Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 149319 - app-portage/portage-utils - emerge printing non error messages to stderr during sync
Summary: app-portage/portage-utils - emerge printing non error messages to stderr duri...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Utils Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-27 09:11 UTC by Toby Murray
Modified: 2006-11-29 12:28 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toby Murray 2006-09-27 09:11:04 UTC
As of the portage update a week or two ago (currently running 2.1.1), emerge --sync prints two lines to stderr which are not error messages. They read:

q: Updating ebuild cache ... 
q: Finished 24603 entries in 0.223286 seconds

This is a problem because I (and several others I have spoken with) have an emerge --sync > /dev/null cron job. The idea is that I don't want to get an email from cron unless something fails - then I DO want to know about it so I don't want to redirect stderr to /dev/null.

There are workarounds however I think it would be best to put these messages on stdout instead of stderr since they do not indicate an error.
Comment 1 solar@gentoo.org 2006-09-27 11:45:59 UTC
portage-utils should only print that if you have the 
/etc/portage/bin/postsync.d/q-reinitialize file installed with the 
executable bit. If you wish to keep that bit (suggested) then you can simply edit 
the file and change the q -r to q -qr and nothing will be printed to stderr. The 
displayed message wont change to stdout as that would break existing scripts alot 
worse.  Also suggested is that when using the emerge --sync option is to use the 
-q quiet option which exports the variable PORTAGE_QUIET which portage-utils also 
keys itself on and invokes -q internally in itself.
Comment 2 Lance Albertson (RETIRED) gentoo-dev 2006-09-27 12:38:30 UTC
zephyr ~ # emerge --sync -q

q: Updating ebuild cache ... 
q: Finished 24598 entries in 0.145821 seconds

I thought the same thing but it still prints it out... Seems like something isn't honoring -quiet. :-)
Comment 3 Toby Murray 2006-10-03 06:59:13 UTC
Well it is /etc/portage/postsync.d/q-reinitialize (no /bin/ in there). Adding the q DOES make the messages go away and this is likely what I will do. But as Lance pointed out, shouldn't specifying -q to emerge also pass it to this script? 

I also still think using stderr for things that aren't errors isn't cool...
Comment 4 TGL 2006-10-03 13:49:04 UTC
Adding a "declare -p PORTAGE_QUIET" in /etc/portage/bin/post_sync shows that Portage (2.1.2_pre2-r2 here) doesn't set this var when it spawns this hook.

Probably this report should be reassigned to dev-portage@ (and severity could be lowered too, since it's more a missing feature than a real bug imho).
Comment 5 solar (RETIRED) gentoo-dev 2006-11-29 12:28:08 UTC
Index: ebuild.sh
===================================================================
--- ebuild.sh	(revision 5141)
+++ ebuild.sh	(working copy)
@@ -60,6 +60,7 @@
 		;;
 esac
 
+[[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
 
 # the sandbox is disabled by default except when overridden in the relevant stages
 export SANDBOX_ON="0"