X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-ian.git;a=blobdiff_plain;f=jpctb;h=3557cd234bcf175845016e7ded7feab13dcb57c0;hp=5157a054c211afa043f6cad945361f28c1f15101;hb=51eeef799e34499922a74027c64622be2cc11a6d;hpb=27ad770787f1e70c9ec77065aa3511b9efc71b2d diff --git a/jpctb b/jpctb index 5157a05..3557cd2 100755 --- a/jpctb +++ b/jpctb @@ -37,11 +37,16 @@ nojre () { fail "couldn't find the right jre: $* perhaps you should make ypp's java symlink (normally yohoho/java) point to your jre, eg to /usr/lib/jvm/java-6-sun" +} badusage () { fail "bad usage: $*" } +check_only=false +setup_only=false +setup_only_simulate='' + while [ $# -ge 1 ]; do case "$1" in -) shift; break;; @@ -50,6 +55,15 @@ while [ $# -ge 1 ]; do srcjardir="$1" shift || badusage "--jpctb needs a value" ;; + --check-only) + check_only=true + shift + ;; + --setup-only) + setup_only=true + setup_only_simulate=echo + shift + ;; -*) badusage "unknown option \`$1'" ;; *) @@ -80,8 +94,8 @@ fi yppdir="${yohoho%/*}" # this replicates the java-searching logic from yohoho/yohoho: -if [ -x "$yohoho/java/bin/java" ]; then - yppjava="$yohoho/java/bin/java" +if [ -x "$yppdir/java/bin/java" ]; then + yppjava="$yppdir/java/bin/java" elif [ -x "$JAVA_HOME/bin/java" ]; then yppjava="$JAVA_HOME/bin/java" else @@ -94,6 +108,7 @@ cat <&2 "control panel failed with exit status $rc"; exit "$rc" ;; +esac + #---------- create the temporary are and link farm ---------- @@ -155,7 +191,7 @@ cp -Rs "$javadir"/. "$linkfarm"/. #---------- edit the linkfarm to have our jvm wrapper ---------- -wrapper="$linkfarm"/jre/bin/java +wrapper="$linkfarm"/$jreleaf/bin/java rm -- "$wrapper" export JPCTB_EXTDIR="$extdir" @@ -204,4 +240,4 @@ chmod +x -- "$wrapper" #---------- now run it ---------- -exec "$yohoho" -Djava.home="$linkfarm/jre" +exec $setup_only_simulate "$yohoho" -Djava.home="$linkfarm/$jreleaf"