Lines 182-206
Link Here
|
182 |
|
182 |
|
183 |
append_jars_to_cp() { |
183 |
append_jars_to_cp() { |
184 |
dir="$1" |
184 |
dir="$1" |
185 |
for ex in jar zip ; do |
185 |
subpath="$2" |
186 |
if [ "`echo "${dir}"/*.$ex`" != "${dir}/*.$ex" ] ; then |
186 |
if [ -z `echo ${paths} | grep ${subpath}` ] ; then |
187 |
for x in "${dir}"/*.$ex ; do |
187 |
if [ ! -z "$paths" ] ; then paths="$paths:" ; fi |
188 |
if [ ! -z "$cp" ] ; then cp="$cp:" ; fi |
188 |
paths="$paths$subpath" |
189 |
cp="$cp$x" |
189 |
for ex in jar zip ; do |
190 |
done |
190 |
if [ "`echo "${dir}"/*.$ex`" != "${dir}/*.$ex" ] ; then |
|
|
191 |
for x in "${dir}"/*.$ex ; do |
192 |
if [ ! -z "$cp" ] ; then cp="$cp:" ; fi |
193 |
echo "*** Added $x" |
194 |
cp="$cp$x" |
195 |
done |
196 |
fi |
197 |
done |
198 |
fi |
199 |
} |
200 |
|
201 |
construct_cp() { |
202 |
cp="" |
203 |
updatercp="" |
204 |
paths="" |
205 |
|
206 |
build_cp "${userdir}" |
207 |
build_cp "${plathome}" |
208 |
|
209 |
if [ -f "${userdir}/modules/ext/updater.jar" ] ; then |
210 |
updatercp="${userdir}/modules/ext/updater.jar" |
211 |
else |
212 |
if [ -f "${plathome}/modules/ext/updater.jar" ] ; then |
213 |
updatercp="${plathome}/modules/ext/updater.jar" |
214 |
fi |
215 |
fi |
216 |
|
217 |
# JDK tools |
218 |
for x in "${jdkhome}/lib/dt.jar" "${jdkhome}/lib/tools.jar"; do |
219 |
if [ -f "$x" ]; then |
220 |
if [ ! -z "$cp" ] ; then cp="$cp:" ; fi |
221 |
cp="${cp}$x" |
191 |
fi |
222 |
fi |
192 |
done |
223 |
done |
|
|
224 |
|
225 |
# user-specified prefix and postfix CLASSPATH |
226 |
|
227 |
if [ ! -z "${prefixcp}" ] ; then |
228 |
cp="${prefixcp}:$cp" |
229 |
fi |
230 |
|
231 |
if [ ! -z "${postfixcp}" ] ; then |
232 |
cp="$cp:${postfixcp}" |
233 |
fi |
234 |
|
235 |
|
236 |
# prepend IDE's classpath to updater's classpath |
237 |
# (just xml-apis.jar and one XML parser would suffice) |
238 |
if [ ! -z "$updatercp" ] ; then |
239 |
updatercp=${cp}:${updatercp} |
240 |
else |
241 |
updatercp=${cp} |
242 |
fi |
193 |
} |
243 |
} |
194 |
|
244 |
|
195 |
build_cp() { |
245 |
build_cp() { |
196 |
base="$1" |
246 |
base="$1" |
197 |
append_jars_to_cp "${base}/lib/patches" |
247 |
append_jars_to_cp "${base}/lib/patches" "patches" |
198 |
append_jars_to_cp "${base}/lib" |
248 |
append_jars_to_cp "${base}/lib" "lib" |
199 |
append_jars_to_cp "${base}/lib/locale" |
249 |
append_jars_to_cp "${base}/lib/locale" "locale" |
200 |
} |
250 |
} |
201 |
|
251 |
|
202 |
do_run_updater() { |
252 |
do_run_updater() { |
203 |
eval "\"$jdkhome/bin/java\"" -classpath "\"${updatercp}\"" $jargs "-Dnetbeans.user=\"$userdir\"" $updater_class "$args" |
253 |
eval "\"$jdkhome/bin/java\"" -classpath "\"${updatercp}\"" $jargs "-Dnetbeans.user=\"$userdir\"" $updater_class "$args" |
|
|
254 |
construct_cp |
204 |
} |
255 |
} |
205 |
|
256 |
|
206 |
look_for_pre_runs() { |
257 |
look_for_pre_runs() { |
Lines 399-446
Link Here
|
399 |
# |
450 |
# |
400 |
# build CLASSPATH |
451 |
# build CLASSPATH |
401 |
# |
452 |
# |
|
|
453 |
construct_cp |
402 |
|
454 |
|
403 |
cp="" |
|
|
404 |
updatercp="" |
405 |
|
406 |
build_cp "${userdir}" |
407 |
build_cp "${plathome}" |
408 |
|
409 |
if [ -f "${userdir}/modules/ext/updater.jar" ] ; then |
410 |
updatercp="${userdir}/modules/ext/updater.jar" |
411 |
else |
412 |
if [ -f "${plathome}/modules/ext/updater.jar" ] ; then |
413 |
updatercp="${plathome}/modules/ext/updater.jar" |
414 |
fi |
415 |
fi |
416 |
|
417 |
# JDK tools |
418 |
for x in "${jdkhome}/lib/dt.jar" "${jdkhome}/lib/tools.jar"; do |
419 |
if [ -f "$x" ]; then |
420 |
if [ ! -z "$cp" ] ; then cp="$cp:" ; fi |
421 |
cp="${cp}$x" |
422 |
fi |
423 |
done |
424 |
|
425 |
# user-specified prefix and postfix CLASSPATH |
426 |
|
427 |
if [ ! -z "${prefixcp}" ] ; then |
428 |
cp="${prefixcp}:$cp" |
429 |
fi |
430 |
|
431 |
if [ ! -z "${postfixcp}" ] ; then |
432 |
cp="$cp:${postfixcp}" |
433 |
fi |
434 |
|
435 |
|
436 |
# prepend IDE's classpath to updater's classpath |
437 |
# (just xml-apis.jar and one XML parser would suffice) |
438 |
if [ ! -z "$updatercp" ] ; then |
439 |
updatercp=${cp}:${updatercp} |
440 |
else |
441 |
updatercp=${cp} |
442 |
fi |
443 |
|
444 |
# First check for pre-run updates. |
455 |
# First check for pre-run updates. |
445 |
if [ "$first_time_starting" ] ; then |
456 |
if [ "$first_time_starting" ] ; then |
446 |
run_updater="" |
457 |
run_updater="" |