If emerge fails because a not yet merged package in world file is masked, the exit code is zero but should be none zero. Reproducible: Always Steps to Reproduce: Write a masked package to /var/lib/portage. For example net-nds/shelldap. Try to update world. binhost ~ # emerge -1uND @world These are the packages that would be merged, in reverse order: Calculating dependencies... done! Total: 0 packages, Size of downloads: 0 KiB !!! Problems have been detected with your world file !!! Please run emaint --check world !!! Ebuilds for the following packages are either all !!! masked or don't exist: net-nds/shelldap Nothing to merge; quitting. Actual Results: Actual results: binhost ~ # echo $? 0 Expected Results: Expected Results: binhost ~ # echo $? 1
I don't think writing things in /var/lib/portage/world directly is "supported". Having a masked package installed isn't really an error either.
(In reply to Mike Gilbert from comment #1) > I don't think writing things in /var/lib/portage/world directly is > "supported". > > Having a masked package installed isn't really an error either. That's not the point. I just used this as small example to trigger the behaviour. I am running emerge from ansible and ansible didn't fail because the return code was 0. Emerge complains about a problem with world file. The Messages starting with "!!!" are printed to stderr. So the main question is if this is an expected behaviour and the output to stderr is just for diagnostic purpose or if it is a serious error and portage should exit with an none zero exit code.
The "Problems have been detected with your world file" thing is intended to be a non-fatal warning message. We could change it to an ewarn style message.
(In reply to Zac Medico from comment #3) > The "Problems have been detected with your world file" thing is intended to > be a non-fatal warning message. We could change it to an ewarn style message. When the behaviour is expected it is ok for me. A workaround for my scripting issue is an additional check if stderr is not empty.