Fix shift error that shows up on Solaris. Get DEPTH with perl.

This commit is contained in:
slamm%netscape.com 1999-05-10 18:44:49 +00:00
parent e79a8247b7
commit 01b91d73a8

View File

@ -33,35 +33,41 @@ dist_bin=""
# Running from dist/bin
if [ -d components -a -d res ]
then
dist_bin="./"
dist_bin="./"
else
# Running from source dir
if [ -f Makefile.in ]
then
dist_bin=`grep -w DEPTH Makefile.in | grep -e "\.\." | awk -F"=" '{ print $2; }'`/dist/bin
fi
# Running from source dir
if [ -f Makefile.in ]
then
depth=`perl -ne '/^DEPTH\s*=(.*)/ and print $1' Makefile.in`
dist_bin=$depth/dist/bin
fi
fi
script_args=""
while [ -n "$(echo $1 | grep '^-')" ]
while [ $# -gt 0 ]
do
case $1 in
-h | --help)
script_args="$script_args -h"
;;
-g | --debug)
script_args="$script_args -g"
;;
-d | --debugger)
script_args="$script_args -d $2"
shift
;;
esac
shift
case $1 in
-h | --help)
script_args="$script_args -h"
shift
;;
-g | --debug)
script_args="$script_args -g"
shift
;;
-d | --debugger)
script_args="$script_args -d $2"
shift 2
;;
-*)
echo "Unknown option: $1" 1>&2
exit 1
;;
*)
break
;;
esac
done
$dist_bin/run-mozilla.sh $script_args ./viewer ${1+"$@"}