summaryrefslogtreecommitdiff
path: root/indra/newview/linux_tools
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-07-11 23:58:11 +0000
committerDon Kjer <don@lindenlab.com>2012-07-11 23:58:11 +0000
commitf0e34ebcd61ee998efa681a211545a7335d60c97 (patch)
tree74865d0d7f27ee1d4153a95d744038dea850bec5 /indra/newview/linux_tools
parenta589bc99701d6258d3dd467a5d36fb989348a758 (diff)
Adding --skip-gridargs argument to secondlife wrapper script on linux.
Diffstat (limited to 'indra/newview/linux_tools')
-rwxr-xr-xindra/newview/linux_tools/wrapper.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh
index 20936c6460..fa9ce703a8 100755
--- a/indra/newview/linux_tools/wrapper.sh
+++ b/indra/newview/linux_tools/wrapper.sh
@@ -117,18 +117,32 @@ export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH}"
# Simply embedding $(<etc/gridargs.dat) into a command line treats each of
# Second, Life and Developer as separate args -- no good. We need bash to
# process quotes using eval.
-# First read it without scanning, then scan that string. Break quoted words
+# First, check if we have been instructed to skip reading in gridargs.dat:
+skip_gridargs=false
+argnum=0
+for ARG in "$@"; do
+ if [ "--skip-gridargs" == "$ARG" ]; then
+ skip_gridargs=true
+ else
+ ARGS[$argnum]="$ARG"
+ argnum=$(($argnum+1))
+ fi
+done
+
+# Second, read it without scanning, then scan that string. Break quoted words
# into a bash array. Note that if gridargs.dat is empty, or contains only
# whitespace, the resulting gridargs array will be empty -- zero entries --
# therefore "${gridargs[@]}" entirely vanishes from the command line below,
# just as we want.
-eval gridargs=("$(<etc/gridargs.dat)")
+if ! $skip_gridargs ; then
+ eval gridargs=("$(<etc/gridargs.dat)")
+fi
# Run the program.
# Don't quote $LL_WRAPPER because, if empty, it should simply vanish from the
# command line. But DO quote "$@": preserve separate args as individually
# quoted. Similar remarks about the contents of gridargs.
-$LL_WRAPPER bin/do-not-directly-run-secondlife-bin "${gridargs[@]}" "$@"
+$LL_WRAPPER bin/do-not-directly-run-secondlife-bin "${gridargs[@]}" "${ARGS[@]}"
LL_RUN_ERR=$?
# Handle any resulting errors