Patchwork utils.bbclass: Tweak create_wrapper

login
register
mail settings
Submitter Richard Purdie
Date June 17, 2013, 2:57 p.m.
Message ID <1371481023.20823.105.camel@ted>
Download mbox | patch
Permalink /patch/51831/
State Accepted
Commit 4569d7403638e4c1f637e3a6adb8dea620dc8543
Headers show

Comments

Richard Purdie - June 17, 2013, 2:57 p.m.
Currently the full path is specified to exec however this may incorporate a
build path which in the nativesdk case, is not transformed to a target system
path. This leads to failures due to incorrect paths.

This patch ensures the full build path is not encoded into the wrapper script.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
Ross Burton - June 17, 2013, 3:02 p.m.
On 17 June 2013 15:57, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> Currently the full path is specified to exec however this may incorporate a
> build path which in the nativesdk case, is not transformed to a target system
> path. This leads to failures due to incorrect paths.
>
> This patch ensures the full build path is not encoded into the wrapper script.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Signed-off-by: Ross Burton <ross.burton@intel.com>

Patch

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index cf8893f..e873c53 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -282,12 +282,12 @@  create_wrapper () {
 	echo "Generating wrapper script for $cmd"
 
 	mv $cmd $cmd.real
-	cmdname=`basename $cmd`.real
+	cmdname=`basename $cmd`
 	cat <<END >$cmd
 #!/bin/bash
 realpath=\`readlink -fn \$0\`
 export $@
-exec -a $cmd \`dirname \$realpath\`/$cmdname "\$@"
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real "\$@"
 END
 	chmod +x $cmd
 }