Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Nov 2004 21:02:20 -0700
From:      Greg Lewis <glewis@eyesbeyond.com>
To:        Christian Laursen <xi@borderworlds.dk>
Cc:        freebsd-java@freebsd.org
Subject:   Re: The new javavmwrapper and PATH
Message-ID:  <20041112040220.GA76106@misty.eyesbeyond.com>
In-Reply-To: <86ekj0c79e.fsf@borg.borderworlds.dk>
References:  <86ekj0c79e.fsf@borg.borderworlds.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Nov 12, 2004 at 12:09:49AM +0100, Christian Laursen wrote:
> I just upgraded to the new javavmwrapper and noticed that one of my java
> programs stopped working.
> 
> It runs binaries usually in the path but javavmwrapper sets the path to
> "/bin:/sbin:/usr/bin:/usr/sbin".
> 
> Shouldn't $LOCALBASE/bin and $LOCALBASE/sbin be part of the path as well?
> 
> Or would it perhaps be better to set the original path back before starting
> the chosen java binary?

Does the attached diff fix this for you?

-- 
Greg Lewis                          Email   : glewis@eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis@FreeBSD.org

--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="path.diff"

Index: src/javavmwrapper.sh
===================================================================
RCS file: /home/pcvs/ports/java/javavmwrapper/src/javavmwrapper.sh,v
retrieving revision 1.8
diff -u -r1.8 javavmwrapper.sh
--- src/javavmwrapper.sh	11 Nov 2004 19:17:37 -0000	1.8
+++ src/javavmwrapper.sh	12 Nov 2004 04:01:31 -0000
@@ -29,6 +29,7 @@
 #
 # MAINTAINER=java@FreeBSD.org
 
+OLD_PATH=${PATH}
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
 PREFIX="%%PREFIX%%"
@@ -42,6 +43,9 @@
 tryJavaCommand () {
     # Check for the command being executable and exec it if so.
     if [ -x "${1}" ]; then
+        if [ ! -z "${OLD_PATH}" ]; then
+            export PATH=${OLD_PATH}
+        fi
         exec "${@}"
     fi
 

--fUYQa+Pmc3FrFX/N--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041112040220.GA76106>