From: <otm...@us...> - 2008-11-11 23:25:28
|
Revision: 5571 http://jython.svn.sourceforge.net/jython/?rev=5571&view=rev Author: otmarhumbel Date: 2008-11-11 23:25:25 +0000 (Tue, 11 Nov 2008) Log Message: ----------- detect JYTHON_HOME if called from the /bin directory Modified Paths: -------------- trunk/installer/src/java/org/python/util/install/driver/jython_test.template trunk/jython/src/shell/jython Modified: trunk/installer/src/java/org/python/util/install/driver/jython_test.template =================================================================== --- trunk/installer/src/java/org/python/util/install/driver/jython_test.template 2008-11-11 17:48:27 UTC (rev 5570) +++ trunk/installer/src/java/org/python/util/install/driver/jython_test.template 2008-11-11 23:25:25 UTC (rev 5571) @@ -8,15 +8,21 @@ # save old home env vars: _OLD_JAVA_HOME=$JAVA_HOME _OLD_JYTHON_HOME=$JYTHON_HOME +# save current dir +_CURDIR=`pwd` cd "$_INSTALL_DIR/bin" -# auto detection of JYTHON_HOME does not yet work -#echo "{3}: only JAVA_HOME:" -#export JAVA_HOME="$_JAVA_HOME" -#export JYTHON_HOME= -#./jython "$_SCRIPT" +echo "{3}: no home:" +export JAVA_HOME= +export JYTHON_HOME= +./jython "$_SCRIPT" +echo "{3}: only JAVA_HOME:" +export JAVA_HOME="$_JAVA_HOME" +export JYTHON_HOME= +./jython "$_SCRIPT" + echo "{3}: only JYTHON_HOME:" export JAVA_HOME= export JYTHON_HOME="$_INSTALL_DIR" @@ -27,6 +33,14 @@ export JYTHON_HOME="$_INSTALL_DIR" ./jython "$_SCRIPT" +cd ~ + +echo "{3}: no home, calling from another working dir:" +export JAVA_HOME= +export JYTHON_HOME= +"$_INSTALL_DIR/bin/jython" "$_SCRIPT" + # cleanup: +cd "$_CURDIR" export JAVA_HOME=$_OLD_JAVA_HOME export JYTHON_HOME=$_OLD_JYTHON_HOME Modified: trunk/jython/src/shell/jython =================================================================== --- trunk/jython/src/shell/jython 2008-11-11 17:48:27 UTC (rev 5570) +++ trunk/jython/src/shell/jython 2008-11-11 23:25:25 UTC (rev 5571) @@ -44,8 +44,15 @@ fi if [ -z "$JYTHON_HOME" ] ; then - JYTHON_HOME_1=`dirname "$PRG"` # the ./bin dir - JYTHON_HOME=`dirname "$JYTHON_HOME_1"` # the . dir + if [ "$PRG" = "./jython" ] ; then + # current dir is /bin dir + JYTHON_HOME_1=`pwd` # the ./bin dir + JYTHON_HOME=`dirname "$JYTHON_HOME_1"` # the . dir + else + # current dir is not /bin dir + JYTHON_HOME_1=`dirname "$PRG"` # the ./bin dir + JYTHON_HOME=`dirname "$JYTHON_HOME_1"` # the . dir + fi fi if [ -z "$JYTHON_OPTS" ] ; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |