[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Mise à jour d'aujourd'hui -> netscape plante : Solution.



Bonjour,

après MAJ netscape refuse de se lancer...
/usr/bin/X11/netscape: line 277: syntax error near unexpected token `(c'
/usr/bin/X11/netscape: line 277: `              for f in (cd $d;ls -1 . | sort); do'
le fichier /etc/alternative/netscape semble erroné.
Ci-joint, un fichier /etc/alternative/netscape qui supprime le problème.
(Ce n'est ni plus ni moins que celui d'avant la MAJ !)
Cordialeemnt.

-- 
Laurent RENAULT 
Tel : 03 22 82 79 70 Fax : 03 22 83 75 02 Fax2 : 03 22 82 76 62
mailto:laurent.renault@mathinfo.u-picardie.fr 	<= Mel bureau
mailto:laurent.renault@online.fr 		<= Mel personnel
http://www.mathinfo.u-picardie.fr/admin		<= Site web en construction ! (Encore !)
#!/bin/sh
###############################################################################
#
# Netscape Wrapper -- written by H. Peter Anvin <hpa@transmeta.com>
#
# (97.06.28)	Modified for Debian by Brian White <bcwhite@pobox.com>
#
# (1998.10.02)  Modified to support the new netscape4x packages.
#		Adam Heath <doogie@debian.org>
#
###############################################################################

#
# Defaults
#
#set -x
ALLOW_ROOT=no
TRACKING=no
SET_DEFAULTS=yes
ALLOW_USERCONFIG=yes
ALLOW_BINOVERRIDE=no
NO_LD_PRELOAD=yes
STALE_LOCK=yes
NFS_HOME=no
MAILCAP=/etc/mailcap
#netscape=BIN:VER:FLA
#navigator=BIN:VER:FLA
#communicator=BIN:VER:FLA
use_ns_remote=yes
DEBUG=no
NS_FIX=no


base_loc=/usr/lib/netscape/base-4
nsremote=${base_loc}/netscape-remote
prefdir=${HOME}/.netscape
pref=$prefdir/preferences.js
pwd=$(pwd)
config=/etc/netscape4/config
usercf=${HOME}/.netscape/config
environ=/etc/netscape4/environment
userenv=${HOME}/.netscape/environment
args="$@"
readlink=${base_loc}/readlink
uri_escape=${base_loc}/uri_escape
# defaults

args="$@"

MAILCAP=/etc/mailcap
[ -e "$config" ] && . $config
[ "$ALLOW_USERCONFIG" = "yes" -a  -e $usercf ] && . $usercf
[ "$DEBUG" = "yes" ] && set -x

# Override some global only options.
s=$(grep '^TRACKING' $config)
[ "$s" ] && eval $s || TRACKING='no'
s=$(egrep '^ALLOW_BINOVERRIDE' $config)
[ "$s" ] && eval $s || ALLOW_BINOVERRIDE='no'

uri_encode() {
	$uri_escape "ABCDEFGHHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890:?+.!~\/=-_#\$%&'(*;<>@[]^\`{}|" "$1"
}
#
# Find out what we are symlinked to.
#
file="$0"
last=$file
while [ "$(basename $file)" != "wrapper" ];do
	last=$file
	file="$($readlink $file)"
	[ x$file = x ] && echo "Can't determine my name.  Aborting. " && exit 1
done
if [ "$(basename $last)" = "wrapper" ];then
	echo "Don't run this directly!"
	exit 1
fi
if [ "$(basename $last)" = "netscape-remote" ];then
	NSREMOTE="$nsremote"
else
	dir="$(dirname $last)"
	BASEN=$(basename $last)
	FLA=$(echo $BASEN | cut -f 2 -d -)
	BIN=$(echo $BASEN | cut -f 1 -d -)
	case $last in
		*ator-?motif-*)	VER=$(echo $BASEN | cut -f 3 -d -);;
		*)		VER=$(basename $(dirname $dir));;
	esac

#

#
# parameters
# --allow-root
#

#
# Process any private cmdline options.
#
args=''
argc=0
while [ $# -gt 0 ];do
	case $1 in
		--allow-root)	ALLOW_ROOT=yes;;
		--no-remote)	nsremote='';;
		--old-window)	OLD_WINDOW=yes;;
		--stale-lock)   STALE_LOCK=yes;;
		*)		args="$args $1";argc=$(($argc+1));;
	esac
	shift
done
set -- $args

if [ "$STALE_LOCK" = "yes" ];then
	if [ -r .netscape/lock ]; then
		ip=$(readlink .netscape/lock | sed 's/:.*$//')
		pid=$(readlink .netscape/lock | sed 's/.*://')
		if [ "$NFS_HOME" = "yes" ];then
			/sbin/ifconfig |  grep -q "addr:$ip" && kill -0 $pid 2>/dev/null || rm .netscape/lock
		else
			kill -0 $pid 2>/dev/null || rm .netscape/lock
		fi
	fi

fi
if [ "$OLD_WINDOW" = "yes" ];then
	new_window=""
else
	new_window=",new-window"
fi
if [ "$use_ns_remote" = "no" ];then
	nsremote=''
fi
if [ "$ALLOW_BINOVERRIDE" = "yes" ];then
	base=$(basename $0 | sed -e 's/-/_/g')
	eval var=\$$base
	if [ "$var" ];then
		q=$(echo $var | cut -f 1 -d :)
		[ $q ] && BIN=$q
		q=$(echo $var | cut -f 2 -d :)
		[ $q ] && VER=$q
		q=$(echo $var | cut -f 3 -d :)
		[ $q ] && FLA=$q
				
	else
		base=${base}_$VER
		eval var=\$$base
		if [ "$var" ];then
			q=$(echo $var | cut -f 1 -d :)
			[ $q ] && BIN=$q
			q=$(echo $var | cut -f 2 -d :)
			[ $q ] && VER=$q
			q=$(echo $var | cut -f 3 -d :)
			[ $q ] && FLA=$q
		fi
	fi
fi

based="/usr/lib/netscape/$VER/$BIN/"
netscape="$based/$BIN-$FLA.real"
LIBC=$based/libc
if [ -e $LIBC ];then
	LIBC=$(cat $LIBC)
else
	LIBC=$(objdump --private-headers $netscape|awk 'BEGIN{FS="\."}/ *NEEDED *libc\.so/{print $3}')
fi


#
# Don't allow running netscape as root
#
if [ "$ALLOW_ROOT" != "yes" ];then
	uid=`id -u`
	if [ $uid -eq 0 ]; then
		echo "$0: Cannot be run an root (for security reasons)"
		exit 1
	fi
fi
fi

tracking() {
	[ "$TRACKING" != :yes: ] && return
	LOG=log
	[ "$USER" ] && LOG="$USER.log"
	echo $LOGDIR/$LOG
	echo -n "$netscape date=\"$(date)\" args=\"$args\" msg=\"" >> $LOGDIR/$LOG
	echo -n "$@" >> $LOGDIR/$LOG
	echo "'" >> $LOGDIR/$LOG
}

#
# Try calling existing netscape with URL, if fail the start new one.
#

showurl () {
	case "$1" in
		*:*)	url="$1" ;;
		/*)	url="file:$1" ;;
		*)	
			if [ -e "$1" ];then
				url=`echo "file:$pwd/$1" | sed -e 's:///*:/:g'`
			else
				url="http://$1";
			fi
			;;
	esac
	tracking nsremote start
	if [ $NSREMOTE ];then
		$nsremote$NSREMOTE -noraise -remote "openURL($(uri_encode $url)$new_window)" \
			2>/dev/null  || netscape "$@"
		mv=$?
		if [ $retval -eq 0 ]; then
			retval=$mv
		fi
	elif [ "$nsremote" ];then
		$nsremote$NSREMOTE -noraise -remote "openURL($(uri_encode $url)$new_window)" \
			2>/dev/null \ || run_netscape "$url"
		mv=$?
		if [ $retval -eq 0 ]; then
			retval=$mv
		fi
	else
		run_netscape "$url"
	fi
}

run_netscape() {
#
# Set some env vars to make things work better
#
	MALLOC_CHECK_=0
	display=$DISPLAY

	[ -e $environ ] && . $environ
	if [ ! -d ${HOME}/.netscape ];then
		install -d ${HOME}/.netscape
		if [ "$SET_DEFAULTS" = "yes" -a -d "/etc/netscape4/defaults" ];then
			cp /etc/netscape4/defaults/*  ${HOME}/.netscape 2>&1 > /dev/null
			chmod 600 ${HOME}/.netscape/*
		fi
		install -d ${HOME}/.netscape/archive ${HOME}/.netscape/cache
	fi
	tracking start
	[ $NPX_PLUGIN_PATH ] && NPX_PLUGIN_PATH=$NPX_PLUGIN_PATH:
	for a in /usr/local/lib/netscape/$VER/plugins \
/usr/local/lib/netscape/plugins \
/usr/lib/netscape/plugins \
/usr/lib/netscape/$VER/plugins \
/usr/lib/netscape/$VER/$BIN/plugins \
${HOME}/.netscape/plugins; do
		if [ -d $a ];then
			NPX_PLUGIN_PATH=${NPX_PLUGIN_PATH}$a:
		fi
		if [ -d $a-libc$LIBC ];then
			NPX_PLUGIN_PATH=${NPX_PLUGIN_PATH}$a-libc$LIBC:
		fi
	done

	[ $NPX_NETHELP_PATH ] && NPX_NETHELP_PATH=$NPX_NETHELP_PATH:
	NPX_NETHELP_PATH=${NPX_NETHELP_PATH}:${HOME}/.netscape/nethelp:\
/usr/lib/netscape/nethelp:\
/usr/lib/netscape/$VER/nethelp:\
/usr/lib/netscape/$VER/$BIN/nethelp

	[ $CLASSPATH ] && CLASSPATH=$CLASSPATH:
	CLASSPATH=${CLASSPATH}:${HOME}/.netscape/java:\
/usr/lib/netscape/java:\
/usr/lib/netscape/$VER/java:\
/usr/lib/netscape/$VER/$BIN/java

	MOZILLA_HOME=$(dirname $netscape)
	export MALLOC_CHECK_ NPX_PLUGIN_PATH NPX_NETHELP_PATH display MOZILLA_HOME CLASSPATH
	if [ "$REMOVE_LOCK" = "yes" ];then
		EXEC=""
	else
		EXEC=exec
	fi
	if [ -r $HOME/.netscape/preferences.js -a -r $HOME/.netscape/preferences ];then
		# This will be regenerated from preferences by netscape.
		rm -f $HOME/.netscape/preferences.js -a
	fi
	if [ "$NS_FIX" = "yes" ];then
		NSFIX_LIB=/lib/libc.so.$LIBC
		if [ -e $NSFIX_LIB ];then
			export NSFIX_LIB
		fi
		LIBFIX=/usr/lib/netscape/base-4/libnsfix-libc$LIBC.so
		if [ -e $LIBFIX ];then
			eval LD_PRELOAD=$LIBFIX $EXEC $netscape $(echo "$@"|sed 's/(/\\(/g;s/)/\\)/g')
		else
			$EXEC $netscape $(echo "$@"|sed 's/(/\\(/g;s/)/\\)/g')
		fi
	else
		$EXEC $netscape $(echo "$@"|sed 's/(/\\(/g;s/)/\\)/g')
	fi
	if [ "$REMOVE_LOCK" = "yes" ];then
		rm ${HOME}/.netscape/lock
	fi
	retval=$?
	tracking stop
}

eval `locale`
LOC=`echo $LANG | cut -b1,2 | tr '[A-Z]' '[a-z]'`

nswrapper=/usr/lib/netscape/base-4/wrapper
if [ X != X${LOC} -a -f ${nswrapper}.${LOC} ]; then
	. ${nswrapper}.${LOC}
fi
#
# Fix "locale" problems when printing to postscript
#
# If the locale uses a decimal separator other than a point printf 
# will complain and it will not return 1.0
#

pnt=$(printf "%1.1f" 1 2>/dev/null)

if [ "$pnt" != 1.0 ]; then
	# Perhaps we have a "dangerous" value for LANG or LC_NUMERIC. Let's
	# try a "safe" value for LC_NUMERIC.
	LC_NUMERIC=C
	export LC_NUMERIC
	pnt=$(printf "%1.1f" 1 2> /dev/null)

	if [ "$pnt" != 1.0 ]; then
		# No, it is LC_ALL which is bad. Set LC_*=$LC_ALL for every category 
		# (as expected) except LC_NUMERIC, and then unset LC_ALL.
		LC_COLLATE=$LC_ALL
		LC_CTYPE=$LC_ALL
		LC_MESSAGES=$LC_ALL
		LC_MONETARY=$LC_ALL
		LC_TIME=$LC_ALL
		unset LC_ALL
		export LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_CTIME
		pnt=$(printf "%1.1f" 1 2> /dev/null)

		if [ "$pnt" != 1.0 ]; then
			# running out of ideas.
			unset LANG
			export LANG
			pnt=$(printf "%1.1f" 1 2> /dev/null)

			if [ "$pnt" != 1.0 ]; then
				echo "Warning: lang/locale settings will cause printing problems"
			fi
		fi
	fi
fi

#
# Decide what to do...
#

retval=0
if [ "$NSREMOTE" ];then
	$NSREMOTE "$@"
elif [ $# -gt 1 ]; then
	if [ $1 = -remote ];then
		$nsremote "$@"
	else
		run_netscape "$@"
	fi
elif [ $# -eq 1 ]; then
	if [ "$(echo $1 | cut -c1)" != "-" ]; then
		showurl "$1"
	else
		run_netscape "$@"
	fi
elif [ -f "$pref" ]; then
# The next line has embedded 'tabs' in it
	homepage=$(grep '"browser.startup.homepage"' $pref |
		sed -e 's/.*, *"//' -e 's/");$//')
	startuppage=$(grep '"browser.startup.page"' $pref |
		sed -e 's/.*, *//' -e 's/);$//')

#	homepage=$(egrep '^HOME_DOCUMENT:[ 	]' $pref |
#		sed -e 's/^HOME_DOCUMENT:[ 	]*//')
	if [ "$homepage" -a -z "$startuppage" ]; then
		showurl "$homepage"
	else
		run_netscape
	fi
else
	run_netscape
fi
exit $retval

Reply to: