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.
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.
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. :-)
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...
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).
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"