[Python-checkins] python/dist/src/Mac/Lib buildtools.py,1.20,1.21
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
Thu, 14 Nov 2002 16:05:50 -0800
Update of /cvsroot/python/python/dist/src/Mac/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv26337
Modified Files:
buildtools.py
Log Message:
Added a hack so we can build applets with a MacPython that uses the
OSX 10.2 apple-supplied Python as its base: if we've copied a symlink
as the executable we remove it and install appletrunner in stead.
Index: buildtools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Lib/buildtools.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** buildtools.py 11 Nov 2002 00:06:14 -0000 1.20
--- buildtools.py 15 Nov 2002 00:05:47 -0000 1.21
***************
*** 300,303 ****
--- 300,314 ----
]
copyapptree(template, destname, exceptlist, progress)
+ # SERIOUS HACK. If we've just copied a symlink as the
+ # executable we assume we're running from the MacPython addon
+ # to 10.2 python. We remove the symlink again and install
+ # the appletrunner script.
+ executable = os.path.join(destname, "Contents/MacOS/python")
+ if os.path.islink(executable):
+ os.remove(executable)
+ dummyfp, appletrunner, d2 = imp.find_module('appletrunner')
+ del dummyfp
+ shutil.copy2(appletrunner, executable)
+ os.chmod(executable, 0775)
# Now either use the .plist file or the default
if progress: