summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-10-31 14:41:02 +0100
committerMichael Stahl <mstahl@redhat.com>2014-10-31 17:55:14 +0100
commite37837c48b739d0a6654b03cddf8f97a753f0af1 (patch)
tree2570b57e7f251671a30389f239368486bf58234c /bin
parentf049b83cc2947efbe7382f23e12fc91fe50a589d (diff)
bin/run: add a convenient shell wrapper to run executables from workdir
Change-Id: Ide3361fd5eba6462095cc45c0c99b1ab27a16262
Diffstat (limited to 'bin')
-rwxr-xr-xbin/run24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/run b/bin/run
new file mode 100755
index 000000000000..365e287ab9d3
--- /dev/null
+++ b/bin/run
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# simple wrapper script to run non-installed executables from workdir
+
+dir=$(realpath "$(pwd)")
+
+while test ! -d "${dir}/instdir/program" ; do
+ if test "${dir}" = "/"; then
+ echo "error: cannot find \"program\" dir from \"$(pwd)\""
+ exit 1
+ fi
+ dir=$(realpath "${dir}/..")
+done
+
+exedir="${dir}"/workdir/LinkTarget/Executable
+export URE_BOOTSTRAP=file://"${dir}"/instdir/program/fundamentalrc
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${dir}"/instdir/ure/lib:"${dir}"/instdir/program
+
+echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
+echo "setting search path to: ${LD_LIBRARY_PATH}"
+echo "execing: ${exedir}/$1"
+
+cd "${dir}"/instdir/program
+exec "${exedir}"/$@