sbin/virtualenv/create_python_env.py
changeset 22 98798bbf6194
parent 0 cc4a51750724
child 32 eac14c3ae625
--- a/sbin/virtualenv/create_python_env.py	Mon Jul 12 19:00:39 2010 +0200
+++ b/sbin/virtualenv/create_python_env.py	Sun Jul 25 14:18:35 2010 +0200
@@ -131,6 +131,13 @@
             if system_str == 'Linux' :
                 olddir = os.getcwd()
                 patch_dest_path = os.path.join(lib_dir,'site-packages','setuptools-0.6c11-py'+'%s.%s' % (sys.version_info[0], sys.version_info[1])+'.egg')
+                if os.path.isfile(patch_dest_path):
+                    # must unzip egg
+                    # rename file and etract all
+                    shutil.move(patch_dest_path, patch_dest_path + ".zip")
+                    zf = zipfile.ZipFile(patch_dest_path + ".zip",'r')
+                    zf.extractall(patch_dest_path)
+                    os.remove(patch_dest_path + ".zip")
                 logger.notify("Patch jcc : %s " % (patch_dest_path))
                 os.chdir(patch_dest_path)
                 p = patch.fromfile(os.path.join(jcc_src_path,"jcc","patches","patch.43.0.6c11"))
@@ -166,7 +173,10 @@
                 destination.write("JCC=$(PYTHON) -m jcc.__main__ --shared --arch x86_64 --arch i386\\n")
                 destination.write("NUM_FILES=2\\n")
             else:
-                destination.write("JCC=$(PYTHON) -m jcc --shared\\n")
+                if sys.version_info >= (2,6) and sys.version_info < (2,7):
+                    destination.write("JCC=$(PYTHON) -m jcc.__main__ --shared\\n")
+                else:
+                    destination.write("JCC=$(PYTHON) -m jcc --shared\\n")
                 destination.write("NUM_FILES=2\\n")
             for line in source:
                 destination.write( line )