[oe-commits] [openembedded-core] 12/13: utils: Fix create_wrapper

git at git.openembedded.org git at git.openembedded.org
Wed Mar 6 16:34:50 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit bfbcd7f122f8e0f6e203d959e2e266eb9fbb831d
Author: Achille Fouilleul <achille.fouilleul at gadz.org>
AuthorDate: Wed Mar 6 16:32:52 2019 +0100

    utils: Fix create_wrapper
    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
    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>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.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 0016e5c..cd3d057 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 "\$@"
 	chmod +x $cmd

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list