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

antocuni at codespeak.net antocuni at codespeak.net
Thu Dec 14 11:04:26 CET 2006


Author: antocuni
Date: Thu Dec 14 11:04:25 2006
New Revision: 35728

Modified:
   pypy/dist/pypy/translator/driver.py
Log:
Place main.exe and pypylib.dll in a separate directory, so you can
have multiple revision of the same target side-by-side.



Modified: pypy/dist/pypy/translator/driver.py
==============================================================================
--- pypy/dist/pypy/translator/driver.py	(original)
+++ pypy/dist/pypy/translator/driver.py	Thu Dec 14 11:04:25 2006
@@ -594,15 +594,20 @@
         usession_path, main_exe_name = os.path.split(main_exe)
         pypylib_dll = os.path.join(usession_path, 'pypylib.dll')
 
-        shutil.copy(main_exe, '.')
-        shutil.copy(pypylib_dll, '.')
-        newexename = self.exe_name % self.get_info()
-        if '/' not in newexename and '\\' not in newexename:
-            newexename = './' + newexename
+        basename = self.exe_name % self.get_info()
+        dirname = basename + '-data/'
+        if '/' not in dirname and '\\' not in dirname:
+            dirname = './' + dirname
+
+        if not os.path.exists(dirname):
+            os.makedirs(dirname)
+        shutil.copy(main_exe, dirname)
+        shutil.copy(pypylib_dll, dirname)
+        newexename = basename
         f = file(newexename, 'w')
         f.write("""#!/bin/bash
-mono "$(dirname $0)/%s" "$@" # XXX doesn't work if it's placed in PATH
-""" % main_exe_name)
+mono "$(dirname $0)/%s/%s" "$@" # XXX doesn't work if it's placed in PATH
+""" % (dirname, main_exe_name))
         f.close()
         os.chmod(newexename, 0755)
 



More information about the Pypy-commit mailing list