From: Hongxu Jia Date: Fri, 24 Aug 2018 08:54:04 +0000 (+0800) Subject: terminal.bbclass: use var-SHELL as the shebang of wrapper script X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~16877 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=27e2ede65f1193e49f9483b08a55495d88740a65;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 Signed-off-by: Richard Purdie --- diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass index a27e10c6ecb..73e765d57aa 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")