Skip to contentSkip to conversation

build: make shell traps less chatty when 'bitbake -v' is used

PATCH New Chris Laplante 1 participant 1 message Aug 19, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: make shell traps less chatty when 'bitbake -v' is used

This shuts up both the DEBUG and EXIT handlers.

Also, remove an unneeded "set -o errtrace" (i.e. set -E), since we no longer use an ERR trap.

---
 lib/bb/build.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
lib/bb/build.py +3 -2
index 5479a53d..94f9cb37 100644
@@ -318,6 +318,7 @@ bb_sh_exit_handler() {
 
 bb_bash_exit_handler() {
     ret=$?
+    { set +x; } > /dev/null
     trap "" DEBUG
     if [ "$ret" != 0 ]; then
         echo "WARNING: ${BASH_SOURCE[0]}:${__BITBAKE_LAST_LINE} exit $ret from '$1'"
@@ -353,8 +354,8 @@ case $BASH_VERSION in
     set -e
     ;;
 *)  trap 'bb_bash_exit_handler "$BASH_COMMAND"' 0
-    trap 'bb_bash_debug_handler' DEBUG
-    set -eE
+    trap '{ bb_bash_debug_handler; } 2>/dev/null' DEBUG
+    set -e
     shopt -s extdebug
     ;;
 esac
Signature · 1 line
2.17.1