blob: 57c6506b93fb7053626aaac7e78816299b198da6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
Index: soffice.sh
===================================================================
--- desktop/scripts/soffice.sh (Revision 277909)
+++ desktop/scripts/soffice.sh (Arbeitskopie)
@@ -30,19 +30,122 @@
#
#*************************************************************************
-#
-# STAR_PROFILE_LOCKING_DISABLED=1
-# export STAR_PROFILE_LOCKING_DISABLED
-#
+if test -z "$HOME"; then
+ HOME=$(getent passwd $(whoami) | cut -d":" -f6)
+fi
-# file locking now enabled by default
-SAL_ENABLE_FILE_LOCKING=1
-export SAL_ENABLE_FILE_LOCKING
+# Ubuntu helper functions
+home_on_nfs()
+{
+ case $(stat -f -c %T $HOME) in cifs|nfs|smb)
+ return 0
+ esac
+ return 1
+}
+file_on_nfs(){
+ for i; do
+ case "$i" in -*) continue; esac
+ [ -f "$i" ] || continue
+ case $(stat -f -c %T "$i") in cifs|nfs|smb)
+ return 0
+ esac
+ done
+ return 1
+}
-# Uncomment the line below if you suspect that OpenGL is not
-# working on your system.
-# SAL_NOOPENGL=true; export SAL_NOOPENGL
+# FIXME: this is conservative; allow more known working configurations
+working_opengl_support()
+{
+ if [ -n "$(lsmod | awk '/^(fglrx|nvidia)/ {print $1}')" ]; then
+ return 1
+ fi
+ return 0
+}
+
+# read Ubuntu config file
+
+FILE_LOCKING=auto
+OPENGL_SUPPORT=no
+if [ -f /etc/openoffice/soffice.sh ]; then
+ . /etc/openoffice/soffice.sh
+fi
+
+# sanity checks
+
+case "$FILE_LOCKING" in
+ auto|yes|no) ;;
+ *)
+ echo >&2 "unknown value '$FILE_LOCKING' for FILE_LOCKING parameter."
+ FILE_LOCKING=auto
+ echo >&2 "FILE_LOCKING reset to '$FILE_LOCKING'"
+esac
+
+case "$OPENGL_SUPPORT" in
+ auto|yes|no) ;;
+ *)
+ echo >&2 "unknown value '$OPENGL_SUPPORT' for OPENGL_SUPPORT parameter."
+ OPENGL_SUPPORT=auto
+ echo >&2 "OPENGL_SUPPORT reset to '$OPENGL_SUPPORT'"
+esac
+
+# adjust environment
+
+if [ -z "$SAL_ENABLE_FILE_LOCKING" ]; then
+ case "$FILE_LOCKING" in
+ auto)
+ home_on_nfs "$@"
+ if [ $? = 0 ]; then
+ STAR_PROFILE_LOCKING_DISABLED=1
+ export STAR_PROFILE_LOCKING_DISABLED
+ fi
+ file_on_nfs "$@"
+ if [ $? = 0 ]; then
+ SAL_ENABLE_FILE_LOCKING=0
+ export SAL_ENABLE_FILE_LOCKING
+ # for safety
+ STAR_ENABLE_FILE_LOCKING=0
+ export STAR_ENABLE_FILE_LOCKING
+ else
+ # file locking now enabled by default
+ SAL_ENABLE_FILE_LOCKING=1
+ export SAL_ENABLE_FILE_LOCKING
+ fi
+ ;;
+ yes)
+ SAL_ENABLE_FILE_LOCKING=1
+ export SAL_ENABLE_FILE_LOCKING
+ ;;
+ no)
+ SAL_ENABLE_FILE_LOCKING=0
+ export SAL_ENABLE_FILE_LOCKING
+ # for safety
+ STAR_ENABLE_FILE_LOCKING=0
+ export STAR_ENABLE_FILE_LOCKING
+ STAR_PROFILE_LOCKING_DISABLED=1
+ export STAR_PROFILE_LOCKING_DISABLED
+ esac
+fi
+
+if [ -z "$SAL_NOOPENGL" ]; then
+ case "$OPENGL_SUPPORT" in
+ auto)
+ working_opengl_support
+ if [ $? -eq 0 ]; then
+ SAL_NOOPENGL=true
+ export SAL_NOOPENGL
+ fi
+ ;;
+ yes)
+ :
+ unset SAL_NOOPENGL
+ #export SAL_NOOPENGL
+ ;;
+ no)
+ SAL_NOOPENGL=true
+ export SAL_NOOPENGL
+ esac
+fi
# the following test is needed on Linux PPC with IBM j2sdk142
if [ "`uname -s`" = "Linux" -a "`uname -m`" = "ppc" ] ; then
JITC_PROCESSOR_TYPE=6
--- desktop/scripts/unopkg.sh-old 2010-02-08 14:53:54.000000000 +0100
+++ desktop/scripts/unopkg.sh 2010-02-08 14:56:44.000000000 +0100
@@ -30,9 +30,45 @@
#
#*************************************************************************
-# enable file locking
-SAL_ENABLE_FILE_LOCKING=1
-export SAL_ENABLE_FILE_LOCKING
+if test -z "$HOME"; then
+ HOME=$(getent passwd $(whoami) | cut -d":" -f6)
+fi
+
+# Ubuntu helper functions
+home_on_nfs()
+{
+ case $(stat -f -c %T $HOME) in cifs|nfs*|smb)
+ return 0
+ esac
+ return 1
+}
+file_on_nfs() {
+ for i; do
+ case "$i" in -*) continue; esac
+ [ -f "$i" ] || continue
+ case $(stat -f -c %T "$i") in cifs|nfs*|smb)
+ return 0
+ esac
+ done
+ return 1
+}
+
+# read Ubuntu config file
+
+FILE_LOCKING=auto
+if [ -f /etc/openoffice/soffice.sh ]; then
+ . /etc/openoffice/soffice.sh
+fi
+
+# sanity checks
+
+case "$FILE_LOCKING" in
+ auto|yes|no) ;;
+ *)
+ echo >&2 "unknown value '$FILE_LOCKING' for FILE_LOCKING parameter."
+ FILE_LOCKING=auto
+ echo >&2 "FILE_LOCKING reset to '$FILE_LOCKING'"
+esac
# resolve installation directory
sd_cwd="`pwd`"
@@ -70,6 +106,48 @@
fi
fi
+# adjust environment
+
+if [ -z "$SAL_ENABLE_FILE_LOCKING" ]; then
+ case "$FILE_LOCKING" in
+ auto)
+ home_on_nfs "$@"
+ if [ $? = 0 ]; then
+ STAR_PROFILE_LOCKING_DISABLED=1
+ export STAR_PROFILE_LOCKING_DISABLED
+ fi
+ if [ "$isshared" = "1" ]; then
+ file_on_nfs "/var/spool/openoffice/uno_packages"
+ if [ $? = 0 ]; then
+ SAL_ENABLE_FILE_LOCKING=0
+ export SAL_ENABLE_FILE_LOCKING
+ # for safety
+ STAR_ENABLE_FILE_LOCKING=0
+ export STAR_ENABLE_FILE_LOCKING
+ STAR_PROFILE_LOCKING_DISABLED=1
+ export STAR_PROFILE_LOCKING_DISABLED
+ else
+ # file locking now enabled by default
+ SAL_ENABLE_FILE_LOCKING=1
+ export SAL_ENABLE_FILE_LOCKING
+ fi
+ fi
+ ;;
+ yes)
+ SAL_ENABLE_FILE_LOCKING=1
+ export SAL_ENABLE_FILE_LOCKING
+ ;;
+ no)
+ SAL_ENABLE_FILE_LOCKING=0
+ export SAL_ENABLE_FILE_LOCKING
+ # for safety
+ STAR_ENABLE_FILE_LOCKING=0
+ export STAR_ENABLE_FILE_LOCKING
+ STAR_PROFILE_LOCKING_DISABLED=1
+ export STAR_PROFILE_LOCKING_DISABLED
+ esac
+fi
+
#collect all bootstrap variables specified on the command line
#so that they can be passed as arguments to javaldx later on
for arg in $@
|