]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils: Fix create_wrapper
authorAchille Fouilleul <achille.fouilleul@gadz.org>
Wed, 6 Mar 2019 15:32:52 +0000 (16:32 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Mar 2019 23:12:06 +0000 (23:12 +0000)
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@gadz.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/utils.bbclass

index 0016e5c4e6d5e91d0e9a550368e80ce8896fd598..cd3d05709ed2b9aa8c208801fcd9b0f3977a0fca 100644 (file)
@@ -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
 }