[OE-core] [PATCH] utils: Fix create_wrapper

Achille Fouilleul achille.fouilleul at gadz.org
Wed Mar 6 15:32:52 UTC 2019


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.fouilleul at 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



More information about the Openembedded-core mailing list