Skip to contentSkip to conversation

utils.bbclass: Tweak create_wrapper

PATCH In review Richard Purdie 2 participants 2 messages Jun 17, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils.bbclass: Tweak create_wrapper

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.

---

meta/classes/utils.bbclass +2 -2
index cf8893f..e873c53 100644
@@ -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
 }
#1 lore raw
Quoted 7 lines · Richard Purdie

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.