diff -r 2ccd83e5265e o.n.bootstrap/launcher/unix/nbexec --- a/o.n.bootstrap/launcher/unix/nbexec Mon Aug 18 14:14:49 2008 +0200 +++ b/o.n.bootstrap/launcher/unix/nbexec Thu Aug 21 14:41:21 2008 +0200 @@ -182,25 +182,76 @@ append_jars_to_cp() { dir="$1" - for ex in jar zip ; do - if [ "`echo "${dir}"/*.$ex`" != "${dir}/*.$ex" ] ; then - for x in "${dir}"/*.$ex ; do - if [ ! -z "$cp" ] ; then cp="$cp:" ; fi - cp="$cp$x" - done + subpath="$2" + if [ -z `echo ${paths} | grep ${subpath}` ] ; then + if [ ! -z "$paths" ] ; then paths="$paths:" ; fi + paths="$paths$subpath" + for ex in jar zip ; do + if [ "`echo "${dir}"/*.$ex`" != "${dir}/*.$ex" ] ; then + for x in "${dir}"/*.$ex ; do + if [ ! -z "$cp" ] ; then cp="$cp:" ; fi + echo "*** Added $x" + cp="$cp$x" + done + fi + done + fi +} + +construct_cp() { + cp="" + updatercp="" + paths="" + + build_cp "${userdir}" + build_cp "${plathome}" + + if [ -f "${userdir}/modules/ext/updater.jar" ] ; then + updatercp="${userdir}/modules/ext/updater.jar" + else + if [ -f "${plathome}/modules/ext/updater.jar" ] ; then + updatercp="${plathome}/modules/ext/updater.jar" + fi + fi + + # JDK tools + for x in "${jdkhome}/lib/dt.jar" "${jdkhome}/lib/tools.jar"; do + if [ -f "$x" ]; then + if [ ! -z "$cp" ] ; then cp="$cp:" ; fi + cp="${cp}$x" fi done + + # user-specified prefix and postfix CLASSPATH + + if [ ! -z "${prefixcp}" ] ; then + cp="${prefixcp}:$cp" + fi + + if [ ! -z "${postfixcp}" ] ; then + cp="$cp:${postfixcp}" + fi + + + # prepend IDE's classpath to updater's classpath + # (just xml-apis.jar and one XML parser would suffice) + if [ ! -z "$updatercp" ] ; then + updatercp=${cp}:${updatercp} + else + updatercp=${cp} + fi } build_cp() { base="$1" - append_jars_to_cp "${base}/lib/patches" - append_jars_to_cp "${base}/lib" - append_jars_to_cp "${base}/lib/locale" + append_jars_to_cp "${base}/lib/patches" "patches" + append_jars_to_cp "${base}/lib" "lib" + append_jars_to_cp "${base}/lib/locale" "locale" } do_run_updater() { eval "\"$jdkhome/bin/java\"" -classpath "\"${updatercp}\"" $jargs "-Dnetbeans.user=\"$userdir\"" $updater_class "$args" + construct_cp } look_for_pre_runs() { @@ -399,48 +450,8 @@ # # build CLASSPATH # + construct_cp - cp="" - updatercp="" - - build_cp "${userdir}" - build_cp "${plathome}" - - if [ -f "${userdir}/modules/ext/updater.jar" ] ; then - updatercp="${userdir}/modules/ext/updater.jar" - else - if [ -f "${plathome}/modules/ext/updater.jar" ] ; then - updatercp="${plathome}/modules/ext/updater.jar" - fi - fi - - # JDK tools - for x in "${jdkhome}/lib/dt.jar" "${jdkhome}/lib/tools.jar"; do - if [ -f "$x" ]; then - if [ ! -z "$cp" ] ; then cp="$cp:" ; fi - cp="${cp}$x" - fi - done - - # user-specified prefix and postfix CLASSPATH - - if [ ! -z "${prefixcp}" ] ; then - cp="${prefixcp}:$cp" - fi - - if [ ! -z "${postfixcp}" ] ; then - cp="$cp:${postfixcp}" - fi - - - # prepend IDE's classpath to updater's classpath - # (just xml-apis.jar and one XML parser would suffice) - if [ ! -z "$updatercp" ] ; then - updatercp=${cp}:${updatercp} - else - updatercp=${cp} - fi - # First check for pre-run updates. if [ "$first_time_starting" ] ; then run_updater=""