[OE-core] [PATCH 1/1] utils.bbclass: modify create_wrapper to correctly follow symlinks

Saul Wold sgw at linux.intel.com
Wed May 18 18:23:45 UTC 2011


From: Saul Wold <sgw at linux.intel.com>

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

Signed-off-by: Saul Wold <sgw at linux.intel.com>
---
 meta/classes/utils.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 6bcaf86..a789d41 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -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
 }
-- 
1.7.3.4





More information about the Openembedded-core mailing list