diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/javavmwrapper/Makefile | 2 | ||||
-rw-r--r-- | java/javavmwrapper/src/javavmwrapper.sh | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/java/javavmwrapper/Makefile b/java/javavmwrapper/Makefile index fa5cf828819d..86504088e945 100644 --- a/java/javavmwrapper/Makefile +++ b/java/javavmwrapper/Makefile @@ -9,7 +9,7 @@ PORTNAME= javavmwrapper PORTVERSION= 2.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= java MASTER_SITES= # none DISTFILES= # none diff --git a/java/javavmwrapper/src/javavmwrapper.sh b/java/javavmwrapper/src/javavmwrapper.sh index 0ec3334efaf0..7113b252600d 100644 --- a/java/javavmwrapper/src/javavmwrapper.sh +++ b/java/javavmwrapper/src/javavmwrapper.sh @@ -226,10 +226,6 @@ sortConfiguration () { # Check all of the VMs in the configuration file # checkVMs () { - # Sort the configuration. This will also remove duplicates and - # non-existent VMs - sortConfiguration - # Ensure the configuration file exists if [ ! -f "${CONF}" ]; then exit 0 @@ -241,6 +237,10 @@ checkVMs () { exit 1 fi + # Sort the configuration. This will also remove duplicates and + # non-existent VMs + sortConfiguration + # Ensure links are created for every executable for a VM. cat "${CONF}" | \ ( @@ -273,9 +273,10 @@ registerVM () { # Check that the given VM can be found in the configuration file VM=`echo "${1}" | sed -E 's|[[:space:]]*#.*||' 2>/dev/null` + REGISTERED= if [ ! -z "`grep "${VM}" "${CONF}"`" ]; then - echo "${IAM}: error: JavaVM \"${VM}\" is already registered" 1>&2 - exit 1 + echo "${IAM}: warning: JavaVM \"${VM}\" is already registered" 1>&2 + REGISTERED="yes" fi # Check that the VM exists and is "sane" @@ -301,7 +302,9 @@ registerVM () { fi # Add the VM to the configuration file - echo "${1}" >> "${CONF}" + if [ "${REGISTERED}" != "yes" ]; then + echo "${1}" >> "${CONF}" + fi # Create symbolic links as appropriate if they don't exist. JAVA_HOME=`dirname "${VM}"` |