]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils.bbclass: modify create_wrapper to correctly follow symlinks
authorSaul Wold <sgw@linux.intel.com>
Wed, 18 May 2011 04:43:42 +0000 (21:43 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 May 2011 14:15:42 +0000 (15:15 +0100)
This ensures you look up the symbolic link to get the full path

Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/utils.bbclass

index 6bcaf86b05dee038e2b44a6aae36777e8f2a3644..1965d2f1b47f4365314592cef5824a57cbf00599 100644 (file)
@@ -312,7 +312,8 @@ create_wrapper () {
    cmdname=`basename $cmd`.real
    cat <<END >$cmd
 #!/bin/sh
-exec env $@ \`dirname \$0\`/$cmdname "\$@"
+realpath=\`readlink -fn \$0\`
+exec env $@ \`dirname \$realpath\`/$cmdname "\$@"
 END
    chmod +x $cmd
 }