]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
terminal.bbclass: use var-SHELL as the shebang of wrapper script
authorHongxu Jia <hongxu.jia@windriver.com>
Fri, 24 Aug 2018 08:54:04 +0000 (16:54 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Aug 2018 09:27:15 +0000 (10:27 +0100)
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>
meta/classes/terminal.bbclass

index a27e10c6ecbbc55a0a48ec810ccfd5b2c4264d55..73e765d57aac351fa95114c647c8ab10852bd10e 100644 (file)
@@ -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")