This bug tracks the implementation of the EAPI 3 feature mentioned in the summary.
Failure behaviour and related commands Where a command is listed as having EAPI dependent failure behaviour, a failure shall either result in a non-zero exit status or abort the build process, as determined by table 12.3. The following commands affect this behaviour: nonfatal Executes the remainder of its arguments as a command, preserving the exit status. If this results in a command being called that would normally abort the build process due to a failure (but not due to an explicit die or assert call), instead a non-zero exit status shall be returned. Only in EAPIs listed in table 12.3 as supporting nonfatal.
Created attachment 233037 [details, diff] proposed patch Note that keepdir and *opts (defined in ebuild.sh) already die on failure.
Created attachment 233049 [details, diff] updated patch Following few's suggestions to remove code duplication, this time I added a helpers_die() function in isolated-function.sh which dies if the EAPI is 4 and only outputs to stderr otherwise. All utilities now call that function on error, and so the code is not duplicated. Notes: 1. Forgot to do emake last time. 2. As currently implemented, einstall dies on failure regardless of EAPI (as do keepdir and all *opts functions), contrary to what is said in PMS.
Created attachment 233159 [details, diff] updated patch Reverse logic of helpers_die to echo on EAPI=0|1|2|3 and die otherwise (instead of dying on EAPI 4 and echo otherwise), and make *into die as well.
The patch looks good, but one thing I noticed was this construct in ebuild.sh that seems invalid: if ! install ... ; then ret=$? ... fi This test case shows why it's invalid: $ if ! false ; then echo $? ; fi 0
This is in git now: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=65c1a6e0dddf0d99af7adbd41484150d5fc6ef9c (In reply to comment #5) > The patch looks good, but one thing I noticed was this construct in ebuild.sh > that seems invalid: Fixed here: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=22ab3600b09fd1e4741454d221b5006a1a50efb1
The die helper is now improved with a fancy IPC mechanism: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=12cbc8821476dcbac38464a41f7cb336da7ac0c9