[bitbake-devel] [PATCH] build: Exit scripts with result of last shell function

Andre McCurdy armccurdy at gmail.com
Thu Jul 23 23:09:01 UTC 2015

Since shell scripts run with 'set -e' the final exit at the end of the
script can only be returning 0. However, for correctness and to follow
the original intention of the 'cleanup' commands, let's fix the typo
and return the success of the last shell function rather than the
success of unhooking the exit trap handler.

Signed-off-by: Andre McCurdy <armccurdy at gmail.com>
 lib/bb/build.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 3439964..764163f 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -313,7 +313,7 @@ def exec_func_shell(func, d, runfile, cwd=None):
 # cleanup
 trap '' 0
-exit $?
+exit $ret
     os.chmod(runfile, 0775)

More information about the bitbake-devel mailing list