virtualenv/res/lib/lib_create_env.py
changeset 82 89cfc2de7f5e
parent 80 6d444edf94f2
equal deleted inserted replaced
81:1396aaf1a51c 82:89cfc2de7f5e
   122     #install jcc
   122     #install jcc
   123 
   123 
   124     #patch for linux
   124     #patch for linux
   125     if system_str == 'Linux' :
   125     if system_str == 'Linux' :
   126         olddir = os.getcwd()
   126         olddir = os.getcwd()
   127         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')
   127         setuptools_path = os.path.join(lib_dir, 'site-packages', 'setuptools')
   128         if os.path.isfile(patch_dest_path):
   128         if os.path.exists(setuptools_path) and os.path.isdir(setuptools_path):
   129             # must unzip egg
   129             patch_dest_path = os.path.join(lib_dir, 'site-packages')
   130             # rename file and etract all
   130         else:
   131             shutil.move(patch_dest_path, patch_dest_path + ".zip")
   131             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]))
   132             zf = zipfile.ZipFile(patch_dest_path + ".zip",'r')
   132             if os.path.isfile(patch_dest_path):
   133             zf.extractall(patch_dest_path)
   133                 # must unzip egg
   134             os.remove(patch_dest_path + ".zip")
   134                 # rename file and etract all
       
   135                 shutil.move(patch_dest_path, patch_dest_path + ".zip")
       
   136                 zf = zipfile.ZipFile(patch_dest_path + ".zip",'r')
       
   137                 zf.extractall(patch_dest_path)
       
   138                 os.remove(patch_dest_path + ".zip")
   135         logger.notify("Patch jcc : %s " % (patch_dest_path))
   139         logger.notify("Patch jcc : %s " % (patch_dest_path))
   136         os.chdir(patch_dest_path)
   140         os.chdir(patch_dest_path)
   137         p = patch.fromfile(os.path.join(jcc_src_path,"jcc","patches","patch.43.0.6c11"))
   141         p = patch.fromfile(os.path.join(jcc_src_path,"jcc","patches","patch.43.0.6c11"))
   138         p.apply()
   142         p.apply()
   139         os.chdir(olddir)
   143         os.chdir(olddir)
   199     psycopg2_base_path = os.path.join(src_dir,"psycopg2")
   203     psycopg2_base_path = os.path.join(src_dir,"psycopg2")
   200     zf.extractall(psycopg2_base_path)
   204     zf.extractall(psycopg2_base_path)
   201     zf.close()
   205     zf.close()
   202     
   206     
   203     psycopg2_src_path = os.path.join(psycopg2_base_path, os.listdir(psycopg2_base_path)[0])
   207     psycopg2_src_path = os.path.join(psycopg2_base_path, os.listdir(psycopg2_base_path)[0])
   204     shutil.copytree(os.path.join(psycopg2_src_path, 'psycopg2'), os.path.abspath(os.path.join(home_dir, 'Lib', 'psycopg2')))
   208     shutil.copytree(os.path.join(psycopg2_src_path, 'psycopg2'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages', 'psycopg2')))
   205     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')))
   209     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')))
   206 
   210 
   207 
   211 
   208 
   212 
   209 def lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, normal_installs, urls=None):
   213 def lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, normal_installs, urls=None):
   210     
   214