Patchwork [11/30] utils.bbclass: modify create_wrapper to correctly follow symlinks

login
register
mail settings
Submitter Saul Wold
Date May 18, 2011, 10:26 p.m.
Message ID <542b82da52bc72f47b44ef0cd1b12019d59de457.1305756950.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/4439/
State New, archived
Headers show

Comments

Saul Wold - May 18, 2011, 10:26 p.m.
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 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Koen Kooi - May 19, 2011, 7:26 p.m.
RP already put this one in.

Op 19 mei 2011, om 21:19 heeft Saul Wold het volgende geschreven:

> 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 |    3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
> index 6bcaf86..1965d2f 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
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 6bcaf86..1965d2f 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
 }