diff options
Diffstat (limited to 'meta/classes/terminal.bbclass')
-rw-r--r-- | meta/classes/terminal.bbclass | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass index 73e765d57a..2dfc7db255 100644 --- a/meta/classes/terminal.bbclass +++ b/meta/classes/terminal.bbclass @@ -1,3 +1,9 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + OE_TERMINAL ?= 'auto' OE_TERMINAL[type] = 'choice' OE_TERMINAL[choices] = 'auto none \ @@ -14,6 +20,7 @@ def oe_terminal_prioritized(): return " ".join(o.name for o in oe.terminal.prioritized()) def emit_terminal_func(command, envdata, d): + import bb.build cmd_func = 'do_terminal' envdata.setVar(cmd_func, 'exec ' + command) @@ -25,8 +32,10 @@ def emit_terminal_func(command, envdata, d): bb.utils.mkdirhier(os.path.dirname(runfile)) with open(runfile, 'w') as script: - script.write('#!/usr/bin/env %s\n' % d.getVar('SHELL')) - script.write('set -e\n') + # Override the shell shell_trap_code specifies. + # If our shell is bash, we might well face silent death. + script.write("#!/bin/bash\n") + script.write(bb.build.shell_trap_code()) bb.data.emit_func(cmd_func, script, envdata) script.write(cmd_func) script.write("\n") @@ -37,7 +46,7 @@ def emit_terminal_func(command, envdata, d): def oe_terminal(command, title, d): import oe.data import oe.terminal - + envdata = bb.data.init() for v in os.environ: |