[pypy-svn] r56326 - pypy/dist/pypy/translator

antocuni at codespeak.net antocuni at codespeak.net
Sat Jul 5 14:32:45 CEST 2008


Author: antocuni
Date: Sat Jul  5 14:32:44 2008
New Revision: 56326

Modified:
   pypy/dist/pypy/translator/driver.py
Log:
follow symlink when searching for *-cli-data and *-jvm.jar



Modified: pypy/dist/pypy/translator/driver.py
==============================================================================
--- pypy/dist/pypy/translator/driver.py	(original)
+++ pypy/dist/pypy/translator/driver.py	Sat Jul  5 14:32:44 2008
@@ -679,8 +679,13 @@
         f = file(newexename, 'w')
         f.write("""#!/bin/bash
 LEDIT=`type -p ledit`
+EXE=`readlink $0`
+if [ -z $EXE ]
+then
+    EXE=$0
+fi
 if  uname -s | grep -iq Cygwin ; then MONO=; else MONO=mono; fi
-$LEDIT $MONO "$(dirname $0)/$(basename $0)-data/%s" "$@" # XXX doesn't work if it's placed in PATH
+$LEDIT $MONO "$(dirname $EXE)/$(basename $EXE)-data/%s" "$@" # XXX doesn't work if it's placed in PATH
 """ % main_exe_name)
         f.close()
         os.chmod(newexename, 0755)
@@ -751,7 +756,12 @@
         f = file(newexename, 'w')
         f.write("""#!/bin/bash
 LEDIT=`type -p ledit`
-$LEDIT java -Xmx256m -jar $0.jar "$@"
+EXE=`readlink $0`
+if [ -z $EXE ]
+then
+    EXE=$0
+fi
+$LEDIT java -Xmx256m -jar $EXE.jar "$@"
 """)
         f.close()
         os.chmod(newexename, 0755)



More information about the Pypy-commit mailing list