[oe-commits] [openembedded-core] 05/10: terminal.bbclass: use var-SHELL as the shebang of wrapper script

git at git.openembedded.org git at git.openembedded.org
Fri Aug 24 11:48:48 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit f0ebc999893a94dea0c05d4fc5e5b6665f46e213
Author: Hongxu Jia <hongxu.jia at windriver.com>
AuthorDate: Fri Aug 24 16:54:04 2018 +0800

    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 at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/terminal.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index a27e10c..73e765d 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")

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list