Date: Thu, 13 May 2010 18:46:05 -0400 From: Jung-uk Kim <jkim@FreeBSD.org> To: freebsd-java@freebsd.org Cc: Mike Jakubik <mike.jakubik@intertainservices.com>, glewis@FreeBSD.org Subject: Re: realpath: : No such file or directory Message-ID: <201005131846.08019.jkim@FreeBSD.org> In-Reply-To: <4BEB0686.6050603@intertainservices.com> References: <4BEAC59B.9040105@intertainservices.com> <20100512190726.GD83316@deviant.kiev.zoral.com.ua> <4BEB0686.6050603@intertainservices.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-00=_wEI7LLGeDsoJ5I5 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 12 May 2010 03:50 pm, Mike Jakubik wrote: > On 5/12/2010 3:07 PM, Kostik Belousov wrote: > > The realpath(1) was given an empty path. > > > > According to SUSv4, realpath(3) should return ENOENT if "A > > component of file_name does not name an existing file or > > file_name points to an empty string." This was recently brought > > into standard compliance. > > > > Why javavm passes empty path to realpath(1), I do not know. > > It appears the cause is because ${JAVA_HOME} is an empty variable. > > --- > # > # Set up an appropriate JAVA_HOME > # > setJavaHome() { > > echo Debug JAVA_HOME: ${JAVA_HOME} > echo Debug JAVAVM_PREFIX: ${_JAVAVM_PREFIX} > > # Use JAVA_HOME if it's set, unless its set to /usr/local > if [ -n "${JAVA_HOME}" -a \ > "`realpath "${JAVA_HOME}"`" != "`realpath > "${_JAVAVM_PREFIX}"`" ]; then > 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 > > unset JAVA_HOME > --- > > When i run the above: > > + setJavaHome > + echo Debug JAVA_HOME: > Debug JAVA_HOME: > + echo Debug JAVAVM_PREFIX: /usr/local > Debug JAVAVM_PREFIX: /usr/local > + realpath '' > realpath: : No such file or directory The attached patch should fix the annoyance. Jung-uk Kim --Boundary-00=_wEI7LLGeDsoJ5I5 Content-Type: text/plain; charset="iso-8859-1"; name="javavmwrapper.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="javavmwrapper.diff" --- javavmwrapper/Makefile.orig 2010-05-13 15:40:45.000000000 -0400 +++ javavmwrapper/Makefile 2010-05-13 15:31:00.000000000 -0400 @@ -8,7 +8,7 @@ # PORTNAME= javavmwrapper -PORTVERSION= 2.3.4 +PORTVERSION= 2.3.5 CATEGORIES= java MASTER_SITES= # none DISTFILES= # none --- javavmwrapper/src/javavmwrapper.sh.orig 2010-01-18 17:42:58.000000000 -0500 +++ javavmwrapper/src/javavmwrapper.sh 2010-05-13 15:30:32.000000000 -0400 @@ -479,16 +479,16 @@ # setJavaHome() { # Use JAVA_HOME if it's set, unless its set to %%PREFIX%% - if [ -n "${JAVA_HOME}" -a \ - "`realpath "${JAVA_HOME}"`" != "`realpath "${_JAVAVM_PREFIX}"`" ]; then - 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 + if [ -n "${JAVA_HOME}" ]; then + if [ "`realpath "${JAVA_HOME}"`" != "`realpath "${_JAVAVM_PREFIX}"`" ]; then + if [ -f "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then + _JAVAVM_PROG_PATH="${JAVA_HOME}/bin" + return 0 + elif [ -f "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then + _JAVAVM_PROG_PATH="${JAVA_HOME}/jre/bin" + return 0 + fi + fi fi unset JAVA_HOME --Boundary-00=_wEI7LLGeDsoJ5I5--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005131846.08019.jkim>