All of lore.kernel.org
 help / color / mirror / Atom feed
* [oe-core][PATCH 1/1] terminal.bbclass: force bash for devshell
@ 2021-08-12 22:59 Joe Slater
  0 siblings, 0 replies; only message in thread
From: Joe Slater @ 2021-08-12 22:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: joe.slater, randy.macleod

Since shell_trap_code in build.py sets /bin/sh as the interpreter
we will die a silent death if our environment contains things like
"export -f bodilyfunction" and /bin/sh is really /bin/dash.

Fixes this for the case of devshell.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 meta/classes/terminal.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index 6059ae95e0..a564ee7494 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -26,6 +26,9 @@ def emit_terminal_func(command, envdata, d):
     bb.utils.mkdirhier(os.path.dirname(runfile))
 
     with open(runfile, 'w') as script:
+        # 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)
@@ -37,7 +40,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:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-12 22:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 22:59 [oe-core][PATCH 1/1] terminal.bbclass: force bash for devshell Joe Slater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.