aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-08-24 16:54:04 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-28 10:27:15 +0100
commit27e2ede65f1193e49f9483b08a55495d88740a65 (patch)
tree1fa2332b8ed1312ae9ab94eca432e462cc5328da
parent8645c0419456c1bd3ae15a9a7dd2b2e9a960eaf4 (diff)
downloadopenembedded-core-contrib-27e2ede65f1193e49f9483b08a55495d88740a65.tar.gz
openembedded-core-contrib-27e2ede65f1193e49f9483b08a55495d88740a65.tar.bz2
openembedded-core-contrib-27e2ede65f1193e49f9483b08a55495d88740a65.zip
terminal.bbclass: use var-SHELL as the shebang of wrapper script
The devshell.bbclass set var-SHELL to var-DEVSHELL, and terminal.bbclass initial var-SHELL with `bash'. Keep sync with it, use var-SHELL rather than hardcoded `/bin/sh' as the shebang of wrapper script. On Ubuntu host, default shell is dash (/bin/sh -> dash), even though we assign var-SHELL with `/bin/bash', the wrapper script is still dashism. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/terminal.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index a27e10c6ec..73e765d57a 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -25,7 +25,8 @@ def emit_terminal_func(command, envdata, d):
bb.utils.mkdirhier(os.path.dirname(runfile))
with open(runfile, 'w') as script:
- script.write('#!/bin/sh -e\n')
+ script.write('#!/usr/bin/env %s\n' % d.getVar('SHELL'))
+ script.write('set -e\n')
bb.data.emit_func(cmd_func, script, envdata)
script.write(cmd_func)
script.write("\n")