Resolve symlinks as necessary to allow run-mozilla.sh to be called correctly.

Bug #57866 r=bryner a=asa
This commit is contained in:
seawood%netscape.com 2002-03-05 08:43:53 +00:00
Родитель d3ddba1f5a
Коммит 7a5d757e23
1 изменённых файлов: 38 добавлений и 2 удалений

Просмотреть файл

@ -16,7 +16,7 @@
# Reserved.
#
## $Id: mozilla,v 1.11 2001/11/03 05:05:47 seawood%netscape.com Exp $
## $Id: mozilla,v 1.12 2002/03/05 08:43:53 seawood%netscape.com Exp $
##
## Usage:
##
@ -32,7 +32,43 @@
#uncomment for debugging
#set -x
dist_bin=`dirname $0`
#moz_libdir=@libdir@/mozilla
# honor MOZILLA_FIVE_HOME if it's there
if [ -n "$MOZILLA_FIVE_HOME" ] ; then
dist_bin="$MOZILLA_FIVE_HOME"
elif [ -d "$moz_libdir" ]; then
dist_bin=$moz_libdir
else
# Use run-mozilla.sh in the current dir if it exists
# If not, then start resolving symlinks until we find run-mozilla.sh
found=0
progname=$0
curdir=`dirname $progname`
here=`/bin/pwd`
until [ $found != 0 -a -L "$progname" ]; do
run_moz="$curdir/run-mozilla.sh"
if [ -x $run_moz ]; then
dist_bin=$curdir
found=1
else
bn=`basename "$progname"`
cd `dirname "$progname"`
progname=`/bin/ls -l "$bn" |sed -e 's/^.* -> //' `
if [ ! -x "$progname" ]; then
break
fi
curdir=`dirname $progname`
fi
done
cd $here
if [ $found = 0 ]; then
echo "Cannot find mozilla runtime directory. Exiting."
exit 1
fi
fi
script_args=""
moreargs=""
debugging=0