From: Saul Wold Date: Sat, 26 Feb 2011 00:17:28 +0000 (-0800) Subject: utils.bbclass: add new wrapper script X-Git-Tag: 2011-1~2220 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=8c9ecdfa3b3bdebc3f86ce3f18d9467c0cc076f8;p=openembedded-core.git utils.bbclass: add new wrapper script Add a new create_cmdline_wrapper() function that takes cmdline options for commands that need different directories Related to [BUGID #775 Signed-off-by: Saul Wold --- diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index 455b49d54a..e923789c14 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass @@ -271,6 +271,29 @@ oe_machinstall() { fi } +create_cmdline_wrapper () { + # Create a wrapper script + # + # These are useful to work around relocation issues, by setting environment + # variables which point to paths in the filesystem. + # + # Usage: create_wrapper FILENAME [[VAR=VALUE]..] + + cmd=$1 + shift + + # run echo via env to test syntactic validity of the variable arguments + echo "Generating wrapper script for $cmd" + + mv $cmd $cmd.real + cmdname=`basename $cmd`.real + cat <$cmd +#!/bin/sh +exec \`dirname \$0\`/$cmdname "\$@" +END + chmod +x $cmd +} + create_wrapper () { # Create a wrapper script #