summaryrefslogtreecommitdiff
path: root/java/javavmwrapper/src/javavmwrapper.sh
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2004-11-12 16:12:48 +0000
committerGreg Lewis <glewis@FreeBSD.org>2004-11-12 16:12:48 +0000
commit59fc5151e6d2065c7ccf39cf2f654da365bf2738 (patch)
tree720c10464be77228206e1f403328a94265055326 /java/javavmwrapper/src/javavmwrapper.sh
parentUpdate to 2.7. (diff)
. javavmwrapper uses PATH to make sure it gets the system version of
utilities. Unfortunately this overrides any PATH that may have been set by the user and hence affects the ability of java to execute external programmes. So, save the PATH before setting it and then restore it immediately before executing java. . Bump PORTREVISION for this fix. Reported by: Christian Laursen <xi@borderworlds.dk>
Notes
Notes: svn path=/head/; revision=121460
Diffstat (limited to 'java/javavmwrapper/src/javavmwrapper.sh')
-rw-r--r--java/javavmwrapper/src/javavmwrapper.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/javavmwrapper/src/javavmwrapper.sh b/java/javavmwrapper/src/javavmwrapper.sh
index b6447448911f..b3685bd7e17c 100644
--- a/java/javavmwrapper/src/javavmwrapper.sh
+++ b/java/javavmwrapper/src/javavmwrapper.sh
@@ -29,6 +29,7 @@
#
# MAINTAINER=java@FreeBSD.org
+SAVE_PATH=${PATH}
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
PREFIX="%%PREFIX%%"
@@ -42,6 +43,9 @@ MAKE=/usr/bin/make
tryJavaCommand () {
# Check for the command being executable and exec it if so.
if [ -x "${1}" ]; then
+ if [ ! -z "${SAVE_PATH}" ]; then
+ export PATH=${SAVE_PATH}
+ fi
exec "${@}"
fi