a85919d
From 3b77bbe76b9f99d871074e8baa6e0845f4756442 Mon Sep 17 00:00:00 2001
a85919d
From: David Tardon <dtardon@redhat.com>
a85919d
Date: Mon, 3 Feb 2014 20:24:50 +0100
a85919d
Subject: [PATCH] i#86080 unopkg bodge
a85919d
a85919d
---
a85919d
 desktop/scripts/unopkg.sh | 33 +++++++++++++++++++++++++++++++--
a85919d
 1 file changed, 31 insertions(+), 2 deletions(-)
a85919d
a85919d
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
a85919d
index d16d226..aefc918 100755
a85919d
--- a/desktop/scripts/unopkg.sh
a85919d
+++ b/desktop/scripts/unopkg.sh
a85919d
@@ -53,6 +53,33 @@ AIX)
5e1fb63
     ;;
5e1fb63
 esac
8076325
 
93fc449
+isnotuser=0
8076325
+for arg in $@
8076325
+do
4fd0213
+if [ "$arg" = "--shared" -o "$arg" = "--bundled" ]; then
93fc449
+    isnotuser=1
8076325
+fi
8076325
+done
93fc449
+if [ $isnotuser -eq 1 ]; then
8076325
+    echo $@ | grep -q env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY
8076325
+    if [ $? -ne 0 ]; then
8076325
+        set -- $@ '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
8076325
+    fi
8076325
+    echo $@ | grep -q env:UNO_JAVA_JFW_INSTALL_DATA
8076325
+    if [ $? -ne 0 -a -w $sd_prog/../share/config/javasettingsunopkginstall.xml ]; then
8076325
+        set -- $@ '-env:UNO_JAVA_JFW_INSTALL_DATA=$$ORIGIN/../share/config/javasettingsunopkginstall.xml'
8076325
+    fi
8076325
+    echo $@ | grep -q env:UserInstallation
8076325
+    if [ $? -ne 0 ]; then
8076325
+        INSTDIR=`/bin/mktemp -d --tmpdir unoinstall.XXXXXX`
8076325
+        if [ $? -ne 0 ]; then
8076325
+            echo "Could not create tmp dir" >&2
8076325
+            exit 1
8076325
+        fi
8076325
+        set -- $@ '-env:UserInstallation=file://'$INSTDIR
8076325
+    fi
8076325
+fi
8076325
+
8076325
 #collect all bootstrap variables specified on the command line
8076325
 #so that they can be passed as arguments to javaldx later on
e3b84da
 for arg in $@
a85919d
@@ -92,6 +119,8 @@ unset XENVIRONMENT
8076325
 # SAL_NO_XINITTHREADS=true; export SAL_NO_XINITTHREADS
8076325
 
8076325
 # execute binary
e3b84da
-exec "$sd_prog/unopkg.bin" "$@" \
e3b84da
+"$sd_prog/unopkg.bin" "$@" \
8076325
     "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"
8076325
-
8076325
+if [ -n "$INSTDIR" ]; then
8076325
+   rm -rf $INSTDIR
8076325
+fi
a85919d
-- 
a85919d
1.8.4.2
a85919d