summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPaulo Neves <ptsneves@gmail.com>2022-07-03 13:41:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-04 15:15:11 +0100
commit47973fd4f3fbb0af1a0d1bc2c39f2900a963177d (patch)
tree1bec3126946415f5f715db44cbb7f2546867780d /meta/classes
parent68f49af704a4e808ad274d689e884923776edfec (diff)
downloadopenembedded-core-contrib-47973fd4f3fbb0af1a0d1bc2c39f2900a963177d.tar.gz
utils: create_cmdline_shebang_wrapper preserve permission and ownership
The .real command was not given the same permissions and ownership as the original pre-wrap file and this is now fixed. A situation where the original pre-wrap file did not have write permissions would cause a failure in the wrapping is also fixed. Test update also included. Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/utils.bbclass3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index b58c22771f..e6f7f95d80 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -202,6 +202,9 @@ create_cmdline_shebang_wrapper () {
argument="$(sed -ne 's/^#! *//p;q' $cmd)"
# strip the shebang from the real script as we do not want it to be usable anyway
tail -n +2 $cmd > $cmd.real
+ chown --reference=$cmd $cmd.real
+ chmod --reference=$cmd $cmd.real
+ rm -f $cmd
cmdname=$(basename $cmd)
dirname=$(dirname $cmd)
cmdoptions=$@