]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils.bbclass: fix create_cmdline_wrapper
authorJavier Viguera <javier.viguera@digi.com>
Tue, 17 Feb 2015 12:48:14 +0000 (13:48 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 3 Mar 2015 14:32:38 +0000 (14:32 +0000)
Similar to commit 4569d74 for create_wrapper function, this commit fixes
hardcoded absolute build paths in create_cmdline_wrapper.

Otherwise we end up with incorrect paths in users of this function. For
example the 'file' wrapper in current released toolchain:

exec -a
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-fsl-arm/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-file/5.18-r0/image//opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/bin/file
`dirname $realpath`/file.real --magic-file
/opt/poky/1.7.1/sysroots/x86_64-pokysdk-linux/usr/share/misc/magic.mgc
"$@"

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/utils.bbclass

index 0f2a48409170b57d4b2eed9c1461bdca81c0cd4f..80e90e87778bad8d3fb953fbb73742f4050f2915 100644 (file)
@@ -259,11 +259,11 @@ create_cmdline_wrapper () {
        echo "Generating wrapper script for $cmd"
 
        mv $cmd $cmd.real
-       cmdname=`basename $cmd`.real
+       cmdname=`basename $cmd`
        cat <<END >$cmd
 #!/bin/bash
 realpath=\`readlink -fn \$0\`
-exec -a $cmd \`dirname \$realpath\`/$cmdname $@ "\$@"
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $@ "\$@"
 END
        chmod +x $cmd
 }