summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorAchille Fouilleul <achille.fouilleul@gadz.org>2019-03-06 16:32:52 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-06 23:12:06 +0000
commit791e5bfcb449024f295a4f8f507c1012cff76f9d (patch)
tree12efbdc05ddab3a094c4d981186fc022ce6bd1c0 /meta/classes
parent6319a59c1d30eeb8ad4871d43641e3469fb543ba (diff)
downloadopenembedded-core-791e5bfcb449024f295a4f8f507c1012cff76f9d.tar.gz
openembedded-core-791e5bfcb449024f295a4f8f507c1012cff76f9d.tar.bz2
openembedded-core-791e5bfcb449024f295a4f8f507c1012cff76f9d.zip
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 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>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/utils.bbclass2
1 files changed, 1 insertions, 1 deletions
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
}