build system now exclude config-*, turtledemo when copying system python.

also remove __pycache__ dirs when cleaning (new in python 3.2)
This commit is contained in:
2011-02-28 05:59:44 +00:00
parent e09189cf50
commit 5ef65a0a3b
3 changed files with 38 additions and 31 deletions

View File

@@ -624,31 +624,36 @@ def UnixPyBundle(target=None, source=None, env=None):
print '\t"%s"' % py_target
print '\t(skipping copy)\n'
return
# Copied from source/creator/CMakeLists.txt, keep in sync.
print 'Install python from:'
print '\t"%s" into...' % py_src
print '\t"%s"\n' % py_target
run('rm -rf "%s"' % py_target)
try: os.makedirs(os.path.dirname(py_target)) # the final part is copied
except:pass
run('cp -R "%s" "%s"' % (py_src, os.path.dirname(py_target)))
run('rm -rf "%s/distutils"' % py_target)
run('rm -rf "%s/lib2to3"' % py_target)
run('rm -rf "%s/idlelib"' % py_target)
run('rm -rf "%s/tkinter"' % py_target)
run('rm -rf "%s/config"' % py_target)
print '\t"%s" into...' % py_src
print '\t"%s"\n' % py_target
run('rm -rf "%s/site-packages"' % py_target)
run('mkdir "%s/site-packages"' % py_target) # python needs it.'
run("rm -rf '%s'" % py_target)
try:
os.makedirs(os.path.dirname(py_target)) # the final part is copied
except:
pass
run('rm -f "%s/lib-dynload/_tkinter.so"' % py_target)
run('find "%s" -name "test" -prune -exec rm -rf {} \;' % py_target)
run('find "%s" -name "*.py?" -exec rm -rf {} \;' % py_target)
run('find "%s" -name "*.so"-exec strip -s {} \;' % py_target)
run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
run("rm -rf '%s/distutils'" % py_target)
run("rm -rf '%s/lib2to3'" % py_target)
run("rm -rf '%s/idlelib'" % py_target)
run("rm -rf '%s/tkinter'" % py_target)
run("rm -rf '%s/config'" % py_target)
run("rm -rf '%s/site-packages'" % py_target)
run("mkdir '%s/site-packages'" % py_target) # python needs it.'
run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target)
run("find '%s' -type d -name 'test' -prune -exec rm -rf {} ';'" % py_target)
run("find '%s' -type d -name 'config-*' -prune -exec rm -rf {} ';'" % py_target)
run("find '%s' -type d -name 'turtledemo' -prune -exec rm -rf {} ';'" % py_target)
run("find '%s' -type d -name '__pycache__' -exec rm -rf {} ';'" % py_target)
run("find '%s' -name '*.py[co]' -exec rm -rf {} ';'" % py_target)
run("find '%s' -name '*.so' -exec strip -s {} ';'" % py_target)
#### END ACTION STUFF #########