correct virtualenv creation
authorymh <ymh.work@gmail.com>
Tue, 03 May 2011 12:50:57 +0200
changeset 82 89cfc2de7f5e
parent 81 1396aaf1a51c
child 83 3b0882c91a7d
correct virtualenv creation
virtualenv/res/lib/lib_create_env.py
virtualenv/res/src/psycopg2-2.0.10.win32-py2.6-pg8.3.7-release.zip
--- a/virtualenv/res/lib/lib_create_env.py	Tue May 03 00:02:45 2011 +0200
+++ b/virtualenv/res/lib/lib_create_env.py	Tue May 03 12:50:57 2011 +0200
@@ -124,14 +124,18 @@
     #patch for linux
     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")
+        setuptools_path = os.path.join(lib_dir, 'site-packages', 'setuptools')
+        if os.path.exists(setuptools_path) and os.path.isdir(setuptools_path):
+            patch_dest_path = os.path.join(lib_dir, 'site-packages')
+        else:
+            patch_dest_path = os.path.join(lib_dir,'site-packages','setuptools-0.6c11-py%s.%s.egg' % (sys.version_info[0], sys.version_info[1]))
+            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"))
@@ -201,8 +205,8 @@
     zf.close()
     
     psycopg2_src_path = os.path.join(psycopg2_base_path, os.listdir(psycopg2_base_path)[0])
-    shutil.copytree(os.path.join(psycopg2_src_path, 'psycopg2'), os.path.abspath(os.path.join(home_dir, 'Lib', 'psycopg2')))
-    shutil.copy(os.path.join(psycopg2_src_path, 'psycopg2-2.0.10-py2.6.egg-info'), os.path.abspath(os.path.join(home_dir, 'Lib', 'site-packages')))
+    shutil.copytree(os.path.join(psycopg2_src_path, 'psycopg2'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages', 'psycopg2')))
+    shutil.copy(os.path.join(psycopg2_src_path, 'psycopg2-2.0.14-py2.6.egg-info'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages', 'site-packages')))
 
 
 
Binary file virtualenv/res/src/psycopg2-2.0.10.win32-py2.6-pg8.3.7-release.zip has changed