utils.bbclass: modify create_wrapper to correctly follow symlinks

This ensures you look up the symbolic link to get the full path

(From OE-Core rev: a10bd976f4cef54ac50b0c82f885c17a26e5989f)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Saul Wold 2011-05-17 21:43:42 -07:00 committed by Richard Purdie
parent 30358f0658
commit bc386f67b3
1 changed files with 2 additions and 1 deletions

View File

@ -289,7 +289,8 @@ create_cmdline_wrapper () {
cmdname=`basename $cmd`.real
cat <<END >$cmd
#!/bin/sh
exec \`dirname \$0\`/$cmdname "\$@"
realpath=\`readlink -fn \$0\`
exec \`dirname \$realpath\`/$cmdname "\$@"
END
chmod +x $cmd
}