mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 11:28:58 +00:00
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 <sgw@linux.intel.com>
This commit is contained in:
@@ -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 <<END >$cmd
|
||||
#!/bin/sh
|
||||
exec \`dirname \$0\`/$cmdname "\$@"
|
||||
END
|
||||
chmod +x $cmd
|
||||
}
|
||||
|
||||
create_wrapper () {
|
||||
# Create a wrapper script
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user