diff options
author | glewis <glewis@FreeBSD.org> | 2006-06-09 01:58:15 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2006-06-09 01:58:15 +0800 |
commit | 87321e55fe84ec32834881d9899d42532b365725 (patch) | |
tree | eece1bc6fb2fd5fe876f7970b5465ac1b09fd53d /java/javavmwrapper | |
parent | 505ce272dc28f9d98ce37c5d1066a4878736bcf6 (diff) | |
download | freebsd-ports-gnome-87321e55fe84ec32834881d9899d42532b365725.tar.gz freebsd-ports-gnome-87321e55fe84ec32834881d9899d42532b365725.tar.zst freebsd-ports-gnome-87321e55fe84ec32834881d9899d42532b365725.zip |
. Introduce the JAVAVM_DRYRUN variable. If this is set, then javavm will
not invoke any Java programmes, but will instead print out what it would
have invoked and some related settings.
This work was inspired by the PR, but doesn't use its implementation.
PR: 96050
Diffstat (limited to 'java/javavmwrapper')
-rw-r--r-- | java/javavmwrapper/Makefile | 3 | ||||
-rw-r--r-- | java/javavmwrapper/src/javavm.1 | 34 | ||||
-rw-r--r-- | java/javavmwrapper/src/javavmwrapper.sh | 19 |
3 files changed, 50 insertions, 6 deletions
diff --git a/java/javavmwrapper/Makefile b/java/javavmwrapper/Makefile index f7f88c1b2004..41532e62693f 100644 --- a/java/javavmwrapper/Makefile +++ b/java/javavmwrapper/Makefile @@ -8,8 +8,7 @@ # PORTNAME= javavmwrapper -PORTVERSION= 2.1 -PORTREVISION= 3 +PORTVERSION= 2.2 CATEGORIES= java MASTER_SITES= # none DISTFILES= # none diff --git a/java/javavmwrapper/src/javavm.1 b/java/javavmwrapper/src/javavm.1 index 801ba096b3be..4ed8f4129bf6 100644 --- a/java/javavmwrapper/src/javavm.1 +++ b/java/javavmwrapper/src/javavm.1 @@ -130,11 +130,37 @@ Java VM as options. For more information on environment variables which can be used to set options see .Pa %%PREFIX%%/etc/javavm_opts.conf.dist . +.It Ev JAVAVM_DRYRUN +When this variable is set, no Java VM is invoked. +Instead, the Java VM wrapper prints out the following information: +.Bl -tag -width indent +.It Ev JAVA_HOME +The value of the +.Ev JAVA_HOME +environment variable which the Java VM wrapper would have set before +invoking the Java VM. +.It Ev JAVAVM_CONF +The Java VM wrapper configuration file being used. +.It Ev JAVAVM_OPTS_CONF +The Java VM wrapper option configuration file being used. +.It Ev JAVAVM_PROG +The Java VM that would have been invoked. +.It Ev JAVAVM_OPTS +The options that would have been passed to the invoked Java VM. +It is important to note that this variable may not be the same as the +.Ev JAVAVM_OPTS +environment variable due to processing of the Java VM wrapper option +configuration file. +.It Ev JAVAVM_COMMAND +The full command line that would have been used to invoke the Java VM. +.El .El .Sh FILES .Bl -tag -width indent .It Pa %%PREFIX%%/etc/javavms The location of the Java VM wrapper configuration file. +.It Pa %%PREFIX%%/etc/javavm_opts.conf +The location of the Java VM wrapper option configuration file. .It Pa %%PORTSDIR%%/Mk/bsd.java.mk The file usually used, along with .Nm make , @@ -157,6 +183,14 @@ with This is necessary if MyApp uses JNI, for instance. .It Ev JAVA_VERSION="1.2 1.4" Pa %%LOCALBASE%%/bin/java Fl jar Pa MyApp.jar Execute MyApp with either a Java VM that is either version 1.2 or version 1.4. +.It Ev JAVAVM_DRYRUN=yes Pa %%LOCALBASE%%/bin/java +Don't invoke the Java VM, but print out information about what would have +been done. +This could be used in a script to determine the +.Ev JAVA_HOME +that the Java VM wrapper will use, for instance: +.Lp +.Ev JAVA_HOME=`env JAVAVM_DRYRUN=yes %%LOCALBASE%%/bin/java | grep '^JAVA_HOME' | cut -c11-` .El .Sh SEE ALSO .Xr checkvms 1 , diff --git a/java/javavmwrapper/src/javavmwrapper.sh b/java/javavmwrapper/src/javavmwrapper.sh index 63894a39c757..6881172e731b 100644 --- a/java/javavmwrapper/src/javavmwrapper.sh +++ b/java/javavmwrapper/src/javavmwrapper.sh @@ -42,6 +42,17 @@ _JAVAVM_MAKE=/usr/bin/make # Try to run a Java command. # tryJavaCommand () { + # If this is a test run, spit out the configuration and exit + if [ -n "${JAVAVM_DRYRUN}" ]; then + echo "JAVA_HOME=${JAVA_HOME}" + echo "JAVAVM_CONF=${_JAVAVM_CONF}" + echo "JAVAVM_OPTS_CONF=${_JAVAVM_OPTS_CONF}" + echo "JAVAVM_PROG=${1}" + echo "JAVAVM_OPTS=${_JAVAVM_OPTS}" + echo "JAVAVM_COMMAND=${@}" + exit 0 + fi + # Check for the command being executable and exec it if so. if [ -x "${1}" ]; then if [ -n "${_JAVAVM_SAVE_PATH}" ]; then @@ -67,16 +78,16 @@ setJavaOptions () { # Possible environment variables are stackable if [ -n "${JAVA_HOME_PROG_OPTS}" ]; then - _JAVAVM_OPTS="${_JAVAVM_OPTS} ${JAVA_HOME_PROG_OPTS}" + _JAVAVM_OPTS="${JAVA_HOME_PROG_OPTS} ${_JAVAVM_OPTS}" fi if [ -n "${JAVA_HOME_OPTS}" ]; then - _JAVAVM_OPTS="${_JAVAVM_OPTS} ${JAVA_HOME_OPTS}" + _JAVAVM_OPTS="${JAVA_HOME_OPTS} ${_JAVAVM_OPTS}" fi if [ -n "${PROG_OPTS}" ]; then - _JAVAVM_OPTS="${_JAVAVM_OPTS} ${PROG_OPTS}" + _JAVAVM_OPTS="${PROG_OPTS} ${_JAVAVM_OPTS}" fi if [ -n "${JAVAVM_OPTS}" ]; then - _JAVAVM_OPTS="${_JAVAVM_OPTS} ${JAVAVM_OPTS}" + _JAVAVM_OPTS="${JAVAVM_OPTS} ${_JAVAVM_OPTS}" fi } |