$OpenBSD: patch-install_sh,v 1.24 2010/06/10 06:12:57 ajacoutot Exp $
--- install.sh.orig	Fri Nov 20 20:11:15 2009
+++ install.sh	Wed Jun  9 19:33:20 2010
@@ -870,7 +870,7 @@ generate_wrapper()
     wrapper_contain="#!/bin/sh
 
 # Required for Session Management
-case \$0 in /*) OPERA_SCRIPT_PATH=\$0;; *) OPERA_SCRIPT_PATH=`/bin/pwd`/\$0;; esac
+case \$0 in /*) OPERA_SCRIPT_PATH=\$0;; *) OPERA_SCRIPT_PATH=${str_paramwrapper}/\$0;; esac
 export OPERA_SCRIPT_PATH
 
 # Location of the Opera binaries
@@ -922,9 +922,6 @@ if test \"\${OPERA_DIR}\" = '' ; then
   fi
 fi
 
-OPERA_LD_PRELOAD=\"\${LD_PRELOAD}\"
-export OPERA_LD_PRELOAD
-
 # Native Java enviroment
 for d in \"\$OPERA_PERSONALDIR\" \"\$HOME/.opera\"
 do if test -f \"\$d/javapath.txt\"
@@ -1060,9 +1057,6 @@ if test \"\${OPERA_JAVA_DIR}\"; then
     export LD_LIBRARY_PATH OPERA_JAVA_DIR
 fi
 
-# Workarounds for the \"preloaded libXt\" problem.
-LD_PRELOAD=\"libjvm.so:libawt.so:\${OPERA_LD_PRELOAD}\"
-export LD_PRELOAD
 # To disable the first workaround, comment the next line.
 JAVA_WORKAROUND=\`\${OPERA_BINARYDIR}/works 2>/dev/null\`
 
@@ -1125,6 +1119,12 @@ test -d /usr/sfw/lib/ && LD_LIBRARY_PATH=\"\${LD_LIBRA
 esac
 
 wrapper_contain="${wrapper_contain}
+
+# lock file is not needed as Opera will open a new tab if already
+# running ; this helps recovering from a crash/hang with compat_linux(8)
+if [ -f \${HOME}/.opera/lock ]; then
+	rm -f \${HOME}/.opera/lock
+fi
 
 # Running Opera
 exec \"\${OPERA_BINARYDIR}opera\" \"\$@\"
