openbsd-ports/www/tomcat/v6/patches/patch-bin_setclasspath_sh

24 lines
933 B
Plaintext
Raw Normal View History

$OpenBSD: patch-bin_setclasspath_sh,v 1.1.1.1 2009/01/09 21:38:43 kurt Exp $
--- bin/setclasspath.sh.orig Mon Jul 21 20:01:12 2008
+++ bin/setclasspath.sh Thu Jan 1 14:59:02 2009
@@ -24,6 +24,11 @@
# First clear out the user classpath
CLASSPATH=
+# Read $JAVA_HOME - sudo doesn't pass environment variables
+if [ -r "%%SYSCONFDIR%%/tomcat/tomcat.rc" ]; then
+ . %%SYSCONFDIR%%/tomcat/tomcat.rc
+fi
+
# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
# Bugzilla 37284 (reviewed).
@@ -47,6 +52,7 @@ if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
echo "At least one of these environment variable is needed to run this program"
+ echo "Edit \`%%SYSCONFDIR%%/tomcat/tomcat.rc' to point to your \$JAVA_HOME"
exit 1
fi
fi