]>
Commit | Line | Data |
---|---|---|
c73b4e92 MM |
1 | --- vmware-distrib/bin/vmware 2005-03-23 05:54:18.000000000 -0600 |
2 | +++ vmware-distrib.new/bin/vmware 2005-04-13 09:35:12.000000000 -0500 | |
3 | @@ -8,162 +8,7 @@ | |
4 | # the VMware software is installed. --hpreg | |
5 | # | |
6 | ||
7 | -# BEGINNING_OF_DB_DOT_SH | |
8 | -#!/bin/sh | |
9 | - | |
10 | -# | |
11 | -# Manage an installer database | |
12 | -# | |
13 | - | |
14 | -# Add an answer to a database in memory | |
15 | -db_answer_add() { | |
16 | - local dbvar="$1" # IN/OUT | |
17 | - local id="$2" # IN | |
18 | - local value="$3" # IN | |
19 | - local answers | |
20 | - local i | |
21 | - | |
22 | - eval "$dbvar"'_answer_'"$id"'="$value"' | |
23 | - | |
24 | - eval 'answers="$'"$dbvar"'_answers"' | |
25 | - # There is no double quote around $answers on purpose | |
26 | - for i in $answers; do | |
27 | - if [ "$i" = "$id" ]; then | |
28 | - return | |
29 | - fi | |
30 | - done | |
31 | - answers="$answers"' '"$id" | |
32 | - eval "$dbvar"'_answers="$answers"' | |
33 | -} | |
34 | - | |
35 | -# Remove an answer from a database in memory | |
36 | -db_answer_remove() { | |
37 | - local dbvar="$1" # IN/OUT | |
38 | - local id="$2" # IN | |
39 | - local new_answers | |
40 | - local answers | |
41 | - local i | |
42 | - | |
43 | - eval 'unset '"$dbvar"'_answer_'"$id" | |
44 | - | |
45 | - new_answers='' | |
46 | - eval 'answers="$'"$dbvar"'_answers"' | |
47 | - # There is no double quote around $answers on purpose | |
48 | - for i in $answers; do | |
49 | - if [ "$i" != "$id" ]; then | |
50 | - new_answers="$new_answers"' '"$i" | |
51 | - fi | |
52 | - done | |
53 | - eval "$dbvar"'_answers="$new_answers"' | |
54 | -} | |
55 | - | |
56 | -# Load all answers from a database on stdin to memory (<dbvar>_answer_* | |
57 | -# variables) | |
58 | -db_load_from_stdin() { | |
59 | - local dbvar="$1" # OUT | |
60 | - | |
61 | - eval "$dbvar"'_answers=""' | |
62 | - | |
63 | - # read doesn't support -r on FreeBSD 3.x. For this reason, the following line | |
64 | - # is patched to remove the -r in case of FreeBSD tools build. So don't make | |
65 | - # changes to it. -- Jeremy Bar | |
66 | - while read -r action p1 p2; do | |
67 | - if [ "$action" = 'answer' ]; then | |
68 | - db_answer_add "$dbvar" "$p1" "$p2" | |
69 | - elif [ "$action" = 'remove_answer' ]; then | |
70 | - db_answer_remove "$dbvar" "$p1" | |
71 | - fi | |
72 | - done | |
73 | -} | |
74 | - | |
75 | -# Load all answers from a database on disk to memory (<dbvar>_answer_* | |
76 | -# variables) | |
77 | -db_load() { | |
78 | - local dbvar="$1" # OUT | |
79 | - local dbfile="$2" # IN | |
80 | - | |
81 | - db_load_from_stdin "$dbvar" < "$dbfile" | |
82 | -} | |
83 | - | |
84 | -# Iterate through all answers in a database in memory, calling <func> with | |
85 | -# id/value pairs and the remaining arguments to this function | |
86 | -db_iterate() { | |
87 | - local dbvar="$1" # IN | |
88 | - local func="$2" # IN | |
89 | - shift 2 | |
90 | - local answers | |
91 | - local i | |
92 | - local value | |
93 | - | |
94 | - eval 'answers="$'"$dbvar"'_answers"' | |
95 | - # There is no double quote around $answers on purpose | |
96 | - for i in $answers; do | |
97 | - eval 'value="$'"$dbvar"'_answer_'"$i"'"' | |
98 | - "$func" "$i" "$value" "$@" | |
99 | - done | |
100 | -} | |
101 | - | |
102 | -# If it exists in memory, remove an answer from a database (disk and memory) | |
103 | -db_remove_answer() { | |
104 | - local dbvar="$1" # IN/OUT | |
105 | - local dbfile="$2" # IN | |
106 | - local id="$3" # IN | |
107 | - local answers | |
108 | - local i | |
109 | - | |
110 | - eval 'answers="$'"$dbvar"'_answers"' | |
111 | - # There is no double quote around $answers on purpose | |
112 | - for i in $answers; do | |
113 | - if [ "$i" = "$id" ]; then | |
114 | - echo 'remove_answer '"$id" >> "$dbfile" | |
115 | - db_answer_remove "$dbvar" "$id" | |
116 | - return | |
117 | - fi | |
118 | - done | |
119 | -} | |
120 | - | |
121 | -# Add an answer to a database (disk and memory) | |
122 | -db_add_answer() { | |
123 | - local dbvar="$1" # IN/OUT | |
124 | - local dbfile="$2" # IN | |
125 | - local id="$3" # IN | |
126 | - local value="$4" # IN | |
127 | - | |
128 | - db_remove_answer "$dbvar" "$dbfile" "$id" | |
129 | - echo 'answer '"$id"' '"$value" >> "$dbfile" | |
130 | - db_answer_add "$dbvar" "$id" "$value" | |
131 | -} | |
132 | - | |
133 | -# Add a file to a database on disk | |
134 | -# 'file' is the file to put in the database (it may not exist on the disk) | |
135 | -# 'tsfile' is the file to get the timestamp from, '' if no timestamp | |
136 | -db_add_file() { | |
137 | - local dbfile="$1" # IN | |
138 | - local file="$2" # IN | |
139 | - local tsfile="$3" # IN | |
140 | - local date | |
141 | - | |
142 | - if [ "$tsfile" = '' ]; then | |
143 | - echo 'file '"$file" >> "$dbfile" | |
144 | - else | |
145 | - date=`date -r "$tsfile" '+%s' 2> /dev/null` | |
146 | - if [ "$date" != '' ]; then | |
147 | - date=' '"$date" | |
148 | - fi | |
149 | - echo 'file '"$file$date" >> "$dbfile" | |
150 | - fi | |
151 | -} | |
152 | - | |
153 | -# Add a directory to a database on disk | |
154 | -db_add_dir() { | |
155 | - local dbfile="$1" # IN | |
156 | - local dir="$2" # IN | |
157 | - | |
158 | - echo 'directory '"$dir" >> "$dbfile" | |
159 | -} | |
160 | -# END_OF_DB_DOT_SH | |
161 | - | |
162 | -db_load 'vm_db' '/etc/vmware/locations' | |
163 | +. /etc/vmware/locations | |
164 | ||
165 | if [ "vmware" = "vmware-console" ]; then | |
166 | vmware_config_name="vmware-config-console" | |
167 | --- vmware-distrib/vmware-console-distrib/bin/vmware-console~ 2006-03-01 21:07:14.275705656 +0100 | |
168 | +++ vmware-distrib/vmware-console-distrib/bin/vmware-console 2006-03-01 21:08:49.076293776 +0100 | |
169 | @@ -8,173 +8,18 @@ | |
170 | # the VMware software is installed. --hpreg | |
171 | # | |
172 | ||
173 | -# BEGINNING_OF_DB_DOT_SH | |
174 | -#!/bin/sh | |
175 | +. /etc/vmware-console/locations | |
176 | ||
177 | -# | |
178 | -# Manage an installer database | |
179 | -# | |
180 | - | |
181 | -# Add an answer to a database in memory | |
182 | -db_answer_add() { | |
183 | - local dbvar="$1" # IN/OUT | |
184 | - local id="$2" # IN | |
185 | - local value="$3" # IN | |
186 | - local answers | |
187 | - local i | |
188 | - | |
189 | - eval "$dbvar"'_answer_'"$id"'="$value"' | |
190 | - | |
191 | - eval 'answers="$'"$dbvar"'_answers"' | |
192 | - # There is no double quote around $answers on purpose | |
193 | - for i in $answers; do | |
194 | - if [ "$i" = "$id" ]; then | |
195 | - return | |
196 | - fi | |
197 | - done | |
198 | - answers="$answers"' '"$id" | |
199 | - eval "$dbvar"'_answers="$answers"' | |
200 | -} | |
201 | - | |
202 | -# Remove an answer from a database in memory | |
203 | -db_answer_remove() { | |
204 | - local dbvar="$1" # IN/OUT | |
205 | - local id="$2" # IN | |
206 | - local new_answers | |
207 | - local answers | |
208 | - local i | |
209 | - | |
210 | - eval 'unset '"$dbvar"'_answer_'"$id" | |
211 | - | |
212 | - new_answers='' | |
213 | - eval 'answers="$'"$dbvar"'_answers"' | |
214 | - # There is no double quote around $answers on purpose | |
215 | - for i in $answers; do | |
216 | - if [ "$i" != "$id" ]; then | |
217 | - new_answers="$new_answers"' '"$i" | |
218 | - fi | |
219 | - done | |
220 | - eval "$dbvar"'_answers="$new_answers"' | |
221 | -} | |
222 | - | |
223 | -# Load all answers from a database on stdin to memory (<dbvar>_answer_* | |
224 | -# variables) | |
225 | -db_load_from_stdin() { | |
226 | - local dbvar="$1" # OUT | |
227 | - | |
228 | - eval "$dbvar"'_answers=""' | |
229 | - | |
230 | - # read doesn't support -r on FreeBSD 3.x. For this reason, the following line | |
231 | - # is patched to remove the -r in case of FreeBSD tools build. So don't make | |
232 | - # changes to it. -- Jeremy Bar | |
233 | - while read -r action p1 p2; do | |
234 | - if [ "$action" = 'answer' ]; then | |
235 | - db_answer_add "$dbvar" "$p1" "$p2" | |
236 | - elif [ "$action" = 'remove_answer' ]; then | |
237 | - db_answer_remove "$dbvar" "$p1" | |
238 | - fi | |
239 | - done | |
240 | -} | |
241 | - | |
242 | -# Load all answers from a database on disk to memory (<dbvar>_answer_* | |
243 | -# variables) | |
244 | -db_load() { | |
245 | - local dbvar="$1" # OUT | |
246 | - local dbfile="$2" # IN | |
247 | - | |
248 | - db_load_from_stdin "$dbvar" < "$dbfile" | |
249 | -} | |
250 | - | |
251 | -# Iterate through all answers in a database in memory, calling <func> with | |
252 | -# id/value pairs and the remaining arguments to this function | |
253 | -db_iterate() { | |
254 | - local dbvar="$1" # IN | |
255 | - local func="$2" # IN | |
256 | - shift 2 | |
257 | - local answers | |
258 | - local i | |
259 | - local value | |
260 | - | |
261 | - eval 'answers="$'"$dbvar"'_answers"' | |
262 | - # There is no double quote around $answers on purpose | |
263 | - for i in $answers; do | |
264 | - eval 'value="$'"$dbvar"'_answer_'"$i"'"' | |
265 | - "$func" "$i" "$value" "$@" | |
266 | - done | |
267 | -} | |
268 | - | |
269 | -# If it exists in memory, remove an answer from a database (disk and memory) | |
270 | -db_remove_answer() { | |
271 | - local dbvar="$1" # IN/OUT | |
272 | - local dbfile="$2" # IN | |
273 | - local id="$3" # IN | |
274 | - local answers | |
275 | - local i | |
276 | - | |
277 | - eval 'answers="$'"$dbvar"'_answers"' | |
278 | - # There is no double quote around $answers on purpose | |
279 | - for i in $answers; do | |
280 | - if [ "$i" = "$id" ]; then | |
281 | - echo 'remove_answer '"$id" >> "$dbfile" | |
282 | - db_answer_remove "$dbvar" "$id" | |
283 | - return | |
284 | - fi | |
285 | - done | |
286 | -} | |
287 | - | |
288 | -# Add an answer to a database (disk and memory) | |
289 | -db_add_answer() { | |
290 | - local dbvar="$1" # IN/OUT | |
291 | - local dbfile="$2" # IN | |
292 | - local id="$3" # IN | |
293 | - local value="$4" # IN | |
294 | - | |
295 | - db_remove_answer "$dbvar" "$dbfile" "$id" | |
296 | - echo 'answer '"$id"' '"$value" >> "$dbfile" | |
297 | - db_answer_add "$dbvar" "$id" "$value" | |
298 | -} | |
299 | - | |
300 | -# Add a file to a database on disk | |
301 | -# 'file' is the file to put in the database (it may not exist on the disk) | |
302 | -# 'tsfile' is the file to get the timestamp from, '' if no timestamp | |
303 | -db_add_file() { | |
304 | - local dbfile="$1" # IN | |
305 | - local file="$2" # IN | |
306 | - local tsfile="$3" # IN | |
307 | - local date | |
308 | - | |
309 | - if [ "$tsfile" = '' ]; then | |
310 | - echo 'file '"$file" >> "$dbfile" | |
311 | - else | |
312 | - date=`date -r "$tsfile" '+%s' 2> /dev/null` | |
313 | - if [ "$date" != '' ]; then | |
314 | - date=' '"$date" | |
315 | - fi | |
316 | - echo 'file '"$file$date" >> "$dbfile" | |
317 | - fi | |
318 | -} | |
319 | - | |
320 | -# Add a directory to a database on disk | |
321 | -db_add_dir() { | |
322 | - local dbfile="$1" # IN | |
323 | - local dir="$2" # IN | |
324 | - | |
325 | - echo 'directory '"$dir" >> "$dbfile" | |
326 | -} | |
327 | -# END_OF_DB_DOT_SH | |
328 | - | |
329 | -db_load 'vm_db' '/etc/vmware-console/locations' | |
330 | - | |
331 | -if [ -e '/etc/vmware-console/not_configured' ]; then | |
332 | +if [ -e '/etc/vmware-console/not_configured' ]; then | |
333 | echo 'vmware-console is installed, but it has not been (correctly) configured' | |
334 | echo 'for this system. To (re-)configure it, invoke the following command:' | |
335 | - echo "$vm_db_answer_BINDIR"'/vmware-config-console.pl.' | |
336 | + echo "$VM_BINDIR"'/vmware-config-console.pl.' | |
337 | echo | |
338 | ||
339 | exit 1 | |
340 | fi | |
341 | ||
342 | -exec "$vm_db_answer_LIBDIR"'/lib/wrapper-gtk24.sh' \ | |
343 | - "$vm_db_answer_LIBDIR"'/lib' \ | |
344 | - "$vm_db_answer_LIBDIR"'/bin/vmware-console' \ | |
345 | - "$vm_db_answer_LIBDIR"'/libconf' "$@" | |
346 | +exec "$VM_LIBDIR"'/lib/wrapper-gtk24.sh' \ | |
347 | + "$VM_LIBDIR"'/lib' \ | |
348 | + "$VM_LIBDIR"'/bin/vmware-console' \ | |
349 | + "$VM_LIBDIR"'/libconf' "$@" |