summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2011-02-25 16:17:28 -0800
committerSaul Wold <sgw@linux.intel.com>2011-02-25 16:20:31 -0800
commit9c63e3fd295e4fceb196baadd53801bba3e3e1b3 (patch)
tree16a7caebb62b669dd90bccb07da23cf86a9192ba /meta
parent73553e7850874133d65804719303a08eddd92df0 (diff)
downloadast2050-yocto-poky-9c63e3fd295e4fceb196baadd53801bba3e3e1b3.zip
ast2050-yocto-poky-9c63e3fd295e4fceb196baadd53801bba3e3e1b3.tar.gz
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>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/utils.bbclass23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 455b49d..e923789 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 <<END >$cmd
+#!/bin/sh
+exec \`dirname \$0\`/$cmdname "\$@"
+END
+ chmod +x $cmd
+}
+
create_wrapper () {
# Create a wrapper script
#
OpenPOWER on IntegriCloud