Created
September 4, 2013 05:13
-
-
Save offbyone/6432986 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u a/libexec/bin/jython b/libexec/bin/jython | |
--- a/libexec/bin/jython 2013-09-03 21:37:06.000000000 -0700 | |
+++ b/libexec/bin/jython 2013-09-03 21:44:39.000000000 -0700 | |
@@ -25,19 +25,8 @@ | |
## resolve links - $0 may be a link to home | |
PRG=$0 | |
-while [ -h "$PRG" ] ; do | |
- ls=`ls -ld "$PRG"` | |
- link=`expr "$ls" : '.*-> \(.*\)$'` | |
- if expr "$link" : '.*/.*' > /dev/null; then | |
- if expr "$link" : '/' > /dev/null; then | |
- PRG="$link" | |
- else | |
- PRG="`dirname ${PRG}`/${link}" | |
- fi | |
- else | |
- PRG="`dirname $PRG`/$link" | |
- fi | |
-done | |
+PRG=$(grealpath $0) | |
+JYTHON_HOME=$(dirname $(dirname $PRG)) | |
if [ -z "$JAVA_HOME" ] ; then | |
JAVA_CMD=(java) | |
@@ -48,26 +37,6 @@ | |
JAVA_CMD=("$JAVA_HOME/bin/java") | |
fi | |
-# try to dynamically determine jython home | |
-# (this script typically resides in jython home, or in the /bin subdirectory) | |
-if [ -z "$JYTHON_HOME" ] ; then | |
- if [ "$PRG" = "./jython" ] ; then | |
- # current dir is the script dir | |
- JYTHON_HOME_1=`pwd` | |
- else | |
- # current dir is not the script dir | |
- JYTHON_HOME_1=`dirname "$PRG"` | |
- fi | |
- if [ -f "$JYTHON_HOME_1"/jython.jar -o -f "$JYTHON_HOME_1"/jython-dev.jar ] ; then | |
- JYTHON_HOME="$JYTHON_HOME_1" | |
- else | |
- JYTHON_HOME=`dirname "$JYTHON_HOME_1"` | |
- fi | |
- if [ ! -f "$JYTHON_HOME"/jython.jar -a ! -f "$JYTHON_HOME"/jython-dev.jar ] ; then | |
- JYTHON_HOME="$JYTHON_HOME_FALLBACK" | |
- fi | |
-fi | |
- | |
if [ -z "$JYTHON_OPTS" ] ; then | |
JYTHON_OPTS="" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment