3 usage: .../jpctb /path/to/dir/with/PCTB*.jar /path/to/yohoho/yohoho [...]
12 if [ $# -lt 2 ]; then usage; fail 'bad usage'; exit 127; fi
17 #---------- find ourselves ----------
20 jpctbdir="${jpctbdir%/*}"
24 *) jpctbdir="$PWD/$jpctbdir" ;;
27 #---------- find YPP client and the Java installation it uses ----------
31 if [ -x "$yppdir/java/bin/java" ]; then
32 javadir="$yppdir/java"
33 elif [ x"$JAVA_HOME" != x ] && [ -x "$JAVA_HOME/bin/java" ]; then
36 fail "could not find java runtime system"
41 *) javadir="$PWD/$javadir" ;;
45 linkfarm="$jtmp/linkfarm"
48 #---------- confirm for the user which paths we're using ----------
52 jpctb tree: "$jpctbdir"
55 PCTB jars: "$srcjardir"
59 #---------- create the temporary are and link farm ----------
62 mkdir -- "$jtmp" "$extdir" "$linkfarm"
63 cp "$srcjardir"/PCTB*.jar "$extdir"
65 lndir -silent "$javadir" "$linkfarm"
67 #---------- edit the linkfarm to have our jvm wrapper ----------
69 wrapper="$linkfarm"/jre/bin/java
72 export JPCTB_EXTDIR="$extdir"
73 export JPCTB_JRE="$javadir/jre"
75 cat <<'END' >"$wrapper"
80 lh=`date +'%Y/%m/%d %H:%M:%S jpctb'`
81 printf >&2 "%s: %s |\f\n" "$lh" "$*"
86 #echo >&2 "$djava-wrap
91 yppclass=com.threerings.yohoho.client.YoApp
92 atclass=com.tedpearson.ypp.market.MarketUploader
96 lastarg="${args[$(( $nargs - 1 ))]}"
98 fail () { echo >&2 "jpctb-java: $*"; exit 127; }
100 if [ x"$lastarg" = x"$yppclass" ]; then
102 [ x"$JPCTB_EXTDIR" != x ] || fail 'JPCTB_EXTDIR not set'
104 set -e$JPCTB_JWRAP_X -- \
105 -Djavax.accessibility.assistive_technologies=$atclass \
106 -Djava.ext.dirs="$JPCTB_EXTDIR:$JPCTB_JRE/lib/ext" \
110 real="$JPCTB_JRE/bin/java"
111 log "running $real $*"
115 chmod +x -- "$wrapper"
117 #---------- now run it ----------
119 exec "$yohoho" -Djava.home="$linkfarm/jre"