From owner-freebsd-ports-bugs@FreeBSD.ORG Fri May 11 14:20:13 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0319F1065704 for ; Fri, 11 May 2012 14:20:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C3FBF8FC14 for ; Fri, 11 May 2012 14:20:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4BEKCxD060911 for ; Fri, 11 May 2012 14:20:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4BEKC24060910; Fri, 11 May 2012 14:20:12 GMT (envelope-from gnats) Resent-Date: Fri, 11 May 2012 14:20:12 GMT Resent-Message-Id: <201205111420.q4BEKC24060910@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alfred Bartsch Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49A9F106566C for ; Fri, 11 May 2012 14:13:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 1BE408FC24 for ; Fri, 11 May 2012 14:13:32 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4BEDVM2094632 for ; Fri, 11 May 2012 14:13:31 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q4BEDVve094631; Fri, 11 May 2012 14:13:31 GMT (envelope-from nobody) Message-Id: <201205111413.q4BEDVve094631@red.freebsd.org> Date: Fri, 11 May 2012 14:13:31 GMT From: Alfred Bartsch To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/167799: javavmwrapper-2.3.5 does not always choose the right java vm X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2012 14:20:13 -0000 >Number: 167799 >Category: ports >Synopsis: javavmwrapper-2.3.5 does not always choose the right java vm >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 11 14:20:12 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Alfred Bartsch >Release: FreeBSD 8.3-stable >Organization: Data-Service GmbH >Environment: FreeBSD pcadmin.incore 8.3-STABLE FreeBSD 8.3-STABLE #0: Tue May 8 16:15:10 CEST 2012 root@pcadmin.incore:/usr/obj/usr/src/sys/PCADMIN i386 >Description: javavmwrapper behaves differently, whether it sees an installed portstree or not. At runtime it should not make any difference in behavior, whether a portstree is installed / mounted from anywhere or not. This is primarily a problem, if javavmwrapper runs on another machine than it was built on, or the portstree has changed after building. Changing some java settings in /etc/make.conf may also influence the javavm choice. javavmwrapper should rely only on /usr/local/etc/javavms and /usr/local/etc/javavm_opts.conf while choosing the "right" java vm. >How-To-Repeat: install both diablo-jdk and openjdk. configure javavmwrapper to prefer openjdk. run "java -version" with portstree in /usr/ports -> diablo-jdk is chosen move (temporarily) /usr/ports anywhere run "java -version" again - openjdk is chosen >Fix: Responsible for this unwanted behavior are a couple of lines in javavm shell script which can be simply removed: --- javavm.orig 2011-09-30 04:40:51.000000000 +0200 +++ javavm 2012-05-11 09:07:53.000000000 +0200 @@ -493,30 +493,6 @@ unset JAVA_HOME - # Determine location of bsd.port.mk if it exists - _JAVAVM_PORTSDIR= - if [ -r /usr/share/mk/bsd.port.mk ]; then - _JAVAVM_PORTSDIR=`"${_JAVAVM_MAKE}" -f /usr/share/mk/bsd.port.mk -V PORTSDIR 2>/dev/null` - fi - - _JAVAVM_BSD_PORT_MK= - if [ -n "${_JAVAVM_PORTSDIR}" -a -r "${_JAVAVM_PORTSDIR}/Mk/bsd.port.mk" ]; then - _JAVAVM_BSD_PORT_MK="${_JAVAVM_PORTSDIR}/Mk/bsd.port.mk" - fi - - # If bsd.port.mk was found, use that to determine the VM to use. - if [ -n "${_JAVAVM_BSD_PORT_MK}" ]; then - JAVA_HOME=`"${_JAVAVM_MAKE}" -f "${_JAVAVM_BSD_PORT_MK}" -V JAVA_HOME USE_JAVA=yes 2>/dev/null` - if [ -n "${JAVA_HOME}" -a -f "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then - _JAVAVM_PROG_PATH="${JAVA_HOME}/bin" - return 0 - elif [ -n "${JAVA_HOME}" -a \ - -f "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then - _JAVAVM_PROG_PATH="${JAVA_HOME}/jre/bin" - return 0 - fi - fi - # Then try to make sure that ${_JAVAVM_CONF} exists if [ ! -e "${_JAVAVM_CONF}" ]; then echo "${_JAVAVM_PROG}: error: can't find ${_JAVAVM_CONF} configuration file" 1>&2 >Release-Note: >Audit-Trail: >Unformatted: