diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-08-24 16:54:04 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-28 10:30:28 +0100 |
commit | b7fb4aee255203da3d25b365dd62d6b0ddb04f4b (patch) | |
tree | 81cbcdd04e96ef505057b475927e254627e2ddee /meta/classes/terminal.bbclass | |
parent | f3f4a5f29b3ced8796a411d592123b534030181c (diff) | |
download | poky-b7fb4aee255203da3d25b365dd62d6b0ddb04f4b.tar.gz |
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.
(From OE-Core rev: 27e2ede65f1193e49f9483b08a55495d88740a65)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/terminal.bbclass')
-rw-r--r-- | meta/classes/terminal.bbclass | 3 |
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): | |||
25 | bb.utils.mkdirhier(os.path.dirname(runfile)) | 25 | bb.utils.mkdirhier(os.path.dirname(runfile)) |
26 | 26 | ||
27 | with open(runfile, 'w') as script: | 27 | with open(runfile, 'w') as script: |
28 | script.write('#!/bin/sh -e\n') | 28 | script.write('#!/usr/bin/env %s\n' % d.getVar('SHELL')) |
29 | script.write('set -e\n') | ||
29 | bb.data.emit_func(cmd_func, script, envdata) | 30 | bb.data.emit_func(cmd_func, script, envdata) |
30 | script.write(cmd_func) | 31 | script.write(cmd_func) |
31 | script.write("\n") | 32 | script.write("\n") |