summaryrefslogtreecommitdiffstats
path: root/meta/classes/utils.bbclass
diff options
context:
space:
mode:
authorPaulo Neves <ptsneves@gmail.com>2022-07-03 13:41:12 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-04 15:15:14 +0100
commit0e84a9d697842fce615f2d6a9fbbae121955051c (patch)
tree76435e2a49db8deb8fbbd6c99ef398d12d63860d /meta/classes/utils.bbclass
parent48e4956d71cb0f6e27fce0ef32521c98fcb421ca (diff)
downloadpoky-0e84a9d697842fce615f2d6a9fbbae121955051c.tar.gz
utils: create_cmdline_shebang_wrapper whitespace and sed refactor
Correct whitespace to match the rest of the code in utils. Refactored sed expression with a simpler equivalent. (From OE-Core rev: 68f49af704a4e808ad274d689e884923776edfec) Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/utils.bbclass')
-rw-r--r--meta/classes/utils.bbclass10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index b617632d9f..b58c22771f 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -188,7 +188,7 @@ create_cmdline_shebang_wrapper () {
188 # Create a wrapper script where commandline options are needed 188 # Create a wrapper script where commandline options are needed
189 # 189 #
190 # These are useful to work around shebang relocation issues, where shebangs are too 190 # These are useful to work around shebang relocation issues, where shebangs are too
191 # long or have arguments in them, thus preventing them from using the /usr/bin/env 191 # long or have arguments in them, thus preventing them from using the /usr/bin/env
192 # shebang 192 # shebang
193 # 193 #
194 # Usage: create_cmdline_wrapper FILENAME <extra-options> 194 # Usage: create_cmdline_wrapper FILENAME <extra-options>
@@ -198,10 +198,10 @@ create_cmdline_shebang_wrapper () {
198 198
199 echo "Generating wrapper script for $cmd" 199 echo "Generating wrapper script for $cmd"
200 200
201 # Strip #! and get remaining interpreter + arg 201 # Strip #! and get remaining interpreter + arg
202 argument="$(basename "$(head -n1 $cmd | sed -e 's|#![ ]*||g' )")" 202 argument="$(sed -ne 's/^#! *//p;q' $cmd)"
203 # strip the shebang from the real script as we do not want it to be usable anyway 203 # strip the shebang from the real script as we do not want it to be usable anyway
204 tail -n +2 $cmd > $cmd.real 204 tail -n +2 $cmd > $cmd.real
205 cmdname=$(basename $cmd) 205 cmdname=$(basename $cmd)
206 dirname=$(dirname $cmd) 206 dirname=$(dirname $cmd)
207 cmdoptions=$@ 207 cmdoptions=$@