Wrappers generated by create_wrapper do not work properly:
python, for example, looks at argv[0] to know if it is
running from a virtualenv. Because the wrapper replaces
argv[0] with python's canonical path, python cannot tell
whether it has been invoked directly or from a virtualenv
symlink.

This change makes the wrapper pass the original argv[0] down
to the real command.

Signed-off-by: Achille Fouilleul <achille.fouill...@gadz.org>
---
 meta/classes/utils.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 0016e5c4e6..cd3d05709e 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -264,7 +264,7 @@ create_wrapper () {
 realpath=\`readlink -fn \$0\`
 realdir=\`dirname \$realpath\`
 export $exportstring
-exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real 
"\$@"
+exec -a "\$0" \$realdir/$cmdname.real "\$@"
 END
        chmod +x $cmd
 }
-- 
2.18.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to