# HG changeset patch # User ymh # Date 1275671342 -7200 # Node ID 6f0e728839d6ac6a249420ff5aa56bab81b0b970 # Parent 820dcb93c844292f12638398ec024c779cd4e5d4 add comments diff -r 820dcb93c844 -r 6f0e728839d6 sbin/create_python_env.py --- a/sbin/create_python_env.py Fri Jun 04 17:45:41 2010 +0200 +++ b/sbin/create_python_env.py Fri Jun 04 19:09:02 2010 +0200 @@ -70,7 +70,7 @@ default='', help='base URL of Python Package Index') parser.add_option( - '--type_install', + '--type-install', metavar='type_install', dest='type_install', default='local', @@ -90,16 +90,18 @@ ensure_dir(tmp_dir) system_str = platform.system() - res_source_key = options.typs_install + res_source_key = options.type_install logger.indent += 2 try: #get pylucene + logger.info("Get Pylucene from %s " % URLS['PYLUCENE'][res_source_key]) pylucene_src = os.path.join(src_dir,"pylucene.tar.gz") urllib.urlretrieve(URLS['PYLUCENE'][res_source_key], pylucene_src) tf = tarfile.open(pylucene_src,'r:gz') pylucene_base_path = os.path.join(src_dir,"pylucene") + logger.info("Extract Pylucene to %s " % pylucene_base_path) tf.extractall(pylucene_base_path) tf.close() @@ -109,21 +111,26 @@ #install jcc #patch for linux - if system_str = 'Linux' : + if system_str == 'Linux' : olddir = os.getcwd() - os.chdir(os.path.join(lib_dir,'site-packages','setuptools-0.6c11-py'+'%s.%s' % (sys.version_info[0], sys.version_info[1])+'.egg')) - p = patch.fromfile(os.path.join(jcc_src_path,"jcc","patches","patch.43.0.6c11") + 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') + logger.info("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")) p.apply() os.chdir(olddir) - + logger.info("Install jcc") call_subprocess([os.path.abspath(os.path.join(home_dir, 'bin', 'python')), 'setup.py', 'install'], cwd=jcc_src_path, filter_stdout=filter_python_develop, show_stdout=True) - #install pylucene + #install pylucene + + logger.info("Install pylucene") #modify makefile makefile_path = os.path.join(pylucene_src_path,"Makefile") + logger.info("Modify makefile %s " % makefile_path) shutil.move( makefile_path, makefile_path+"~" ) destination= open( makefile_path, "w" )