In case the number of issues was 256 or its multiples, the executable
would exit 0 as values greater than 255 overflow the range of valid
exit codes (0..255). Example:
In case of issues identified in bitbake metadata, hardcode the exit
code to 1. Ideally the exit code should encode the type of issues
identified, for example, using the convention assumed by pylint
(https://pylint.pycqa.org/en/v3.2.3/user_guide/usage/run.html#exit-codes),
but this is not done in this change, as it requires identifying the
type of changes in the object returned by the run function.
Also, make the code exit according to the valid range for exit codes
and adhere to the conventions in /usr/include/sysexits.h, namely
os.EX_SOFTWARE has not been explicitly used because it might not be
supported by platforms other than Unix. Its value (70) has been used
instead, since we have to use an arbitrary non-zero value in the valid
exit code range anyway.
Always exit non-zero when issues are encountered.
In case the number of issues was 256 or its multiples, the executable would exit
0
as values greater than 255 overflow the range of valid exit codes (0..255). Example:In case of issues identified in bitbake metadata, hardcode the exit code to 1. Ideally the exit code should encode the type of issues identified, for example, using the convention assumed by pylint (https://pylint.pycqa.org/en/v3.2.3/user_guide/usage/run.html#exit-codes), but this is not done in this change, as it requires identifying the type of changes in the object returned by the
run
function.Also, make the code exit according to the valid range for exit codes and adhere to the conventions in
/usr/include/sysexits.h
, namelyfor internal software error.
os.EX_SOFTWARE
has not been explicitly used because it might not be supported by platforms other than Unix. Its value (70) has been used instead, since we have to use an arbitrary non-zero value in the valid exit code range anyway.Signed-off-by: Mario Domenech Goulart Mario.Goulart@bmw.de