Login

    
Login

openoffice 升级至2.4.1后无法启动的故障解决办法

我在linux下用openoffice来处理office文档,虽然LaTeX更好更强大,可是我一没有能够很熟练掌握它的所有操作,二是别人传过来的一些doc xsl ppt格式的文件,还是只能用openoffice来打开。Openoffice根据sjtu源,从2.4升级到2.4.1之后,突然发现打不开了,在字符终端下敲入命令后,出现如下错误提示:


simon@simon:~$ openoffice
/usr/lib/openoffice/program/soffice: line 367: syntax error near unexpected token `fi'
/usr/lib/openoffice/program/soffice: line 367: `fi'

貌似是升级导致的问题。于是打开/usr/lib/openoffice/program/soffice文件,看看发生了什么:


	sudo emacs /usr/lib/openoffice/program/soffice

错误提示中的第367行附近是这样一段代码:


	# test for availability of the fast external splash
	for arg in $@; do
	if [ "$arg" = "-nologo" -o "$arg" = "-no-oosplash" ]; then
	no_oosplash=y
	fi
	fi

	if [ "$sd_binary" = "soffice.bin" -a -x "$sd_prog/oosplash.bin" ] && [ "$no_oosplash" != "y" ] ; then
    sd_binary="oosplash.bin"
	fi

看起来,似乎是因为出现了两个fi导致的重复。bug原因不详。将第二个fi改为done,保存,退出,重新运行openoffice,就一切正常了。
修改后的代码如下:


	# test for availability of the fast external splash
for arg in $@; do
	if [ "$arg" = "-nologo" -o "$arg" = "-no-oosplash" ]; then
		no_oosplash=y
	fi
#fi
done

if [ "$sd_binary" = "soffice.bin" -a -x "$sd_prog/oosplash.bin" ] && [ "$no_oosplash" != "y" ] ; then
    sd_binary="oosplash.bin"
fi

Leave a Reply

You must be logged in to post a comment.