1 --- vmware-distrib/bin/vmware.orig 2004-03-10 00:01:31.000000000 +0100
2 +++ vmware-distrib/bin/vmware 2004-04-06 13:17:34.813580480 +0200
4 # the shared libraries it needs. If a shared library is not available from any
5 # of the standard system-wide locations, we provide it from the VMware package
8 -# BEGINNING_OF_DB_DOT_SH
12 -# Manage an installer database
15 -# Add an answer to a database in memory
17 - local dbvar="$1" # IN/OUT
19 - local value="$3" # IN
23 - eval "$dbvar"'_answer_'"$id"'="$value"'
25 - eval 'answers="$'"$dbvar"'_answers"'
26 - # There is no double quote around $answers on purpose
27 - for i in $answers; do
28 - if [ "$i" = "$id" ]; then
32 - answers="$answers"' '"$id"
33 - eval "$dbvar"'_answers="$answers"'
36 -# Remove an answer from a database in memory
38 - local dbvar="$1" # IN/OUT
44 - eval 'unset '"$dbvar"'_answer_'"$id"
47 - eval 'answers="$'"$dbvar"'_answers"'
48 - # There is no double quote around $answers on purpose
49 - for i in $answers; do
50 - if [ "$i" != "$id" ]; then
51 - new_answers="$new_answers"' '"$i"
54 - eval "$dbvar"'_answers="$new_answers"'
57 -# Load all answers from a database on stdin to memory (<dbvar>_answer_*
59 -db_load_from_stdin() {
60 - local dbvar="$1" # OUT
62 - eval "$dbvar"'_answers=""'
64 - # read doesn't support -r on FreeBSD 3.x. For this reason, the following line
65 - # is patched to remove the -r in case of FreeBSD tools build. So don't make
66 - # changes to it. -- Jeremy Bar
67 - while read -r action p1 p2; do
68 - if [ "$action" = 'answer' ]; then
69 - db_answer_add "$dbvar" "$p1" "$p2"
70 - elif [ "$action" = 'remove_answer' ]; then
71 - db_answer_remove "$dbvar" "$p1"
76 -# Load all answers from a database on disk to memory (<dbvar>_answer_*
79 - local dbvar="$1" # OUT
80 - local dbfile="$2" # IN
82 - db_load_from_stdin "$dbvar" < "$dbfile"
85 -# Iterate through all answers in a database in memory, calling <func> with
86 -# id/value pairs and the remaining arguments to this function
88 - local dbvar="$1" # IN
89 - local func="$2" # IN
95 - eval 'answers="$'"$dbvar"'_answers"'
96 - # There is no double quote around $answers on purpose
97 - for i in $answers; do
98 - eval 'value="$'"$dbvar"'_answer_'"$i"'"'
99 - "$func" "$i" "$value" "$@"
103 -# If it exists in memory, remove an answer from a database (disk and memory)
104 -db_remove_answer() {
105 - local dbvar="$1" # IN/OUT
106 - local dbfile="$2" # IN
111 - eval 'answers="$'"$dbvar"'_answers"'
112 - # There is no double quote around $answers on purpose
113 - for i in $answers; do
114 - if [ "$i" = "$id" ]; then
115 - echo 'remove_answer '"$id" >> "$dbfile"
116 - db_answer_remove "$dbvar" "$id"
122 -# Add an answer to a database (disk and memory)
124 - local dbvar="$1" # IN/OUT
125 - local dbfile="$2" # IN
127 - local value="$4" # IN
129 - db_remove_answer "$dbvar" "$dbfile" "$id"
130 - echo 'answer '"$id"' '"$value" >> "$dbfile"
131 - db_answer_add "$dbvar" "$id" "$value"
134 -# Add a file to a database on disk
135 -# 'file' is the file to put in the database (it may not exist on the disk)
136 -# 'tsfile' is the file to get the timestamp from, '' if no timestamp
138 - local dbfile="$1" # IN
139 - local file="$2" # IN
140 - local tsfile="$3" # IN
143 - if [ "$tsfile" = '' ]; then
144 - echo 'file '"$file" >> "$dbfile"
146 - date=`date -r "$tsfile" '+%s' 2> /dev/null`
147 - if [ "$date" != '' ]; then
150 - echo 'file '"$file$date" >> "$dbfile"
154 -# Add a directory to a database on disk
156 - local dbfile="$1" # IN
157 - local dir="$2" # IN
159 - echo 'directory '"$dir" >> "$dbfile"
163 -db_load 'vm_db' '/etc/vmware/locations'
164 +. /etc/vmware/locations
169 while read -r lib dummy status; do
170 if [ "$status" = 'not found' ]; then
171 if [ "$path" = '' ]; then
172 - path="$vm_db_answer_LIBDIR"'/lib/'"$lib"
173 + path="$VM_LIBDIR"'/lib/'"$lib"
175 - path="$path"':'"$vm_db_answer_LIBDIR"'/lib/'"$lib"
176 + path="$path"':'"$VM_LIBDIR"'/lib/'"$lib"
184 -binary="$vm_db_answer_LIBDIR"'/bin/vmware'
185 +binary="$VM_BINDIR"'/bin/vmware'
186 export LD_LIBRARY_PATH=`LANGUAGE=C LANG=C ldd "$binary" | vm_append_libs`