#NEWLINE# def _patch_egg_dir( path ) : #NEWLINE# #INDENT# pkg_info = os . path . join ( path , 'EGG-INFO' , 'PKG-INFO' ) #NEWLINE# if os . path . exists ( pkg_info ) : #NEWLINE# #INDENT# if _same_content ( pkg_info , SETUPTOOLS_PKG_INFO ) : #NEWLINE# #INDENT# log . warn ( '%s already patched.' , pkg_info ) #NEWLINE# return False #NEWLINE# #UNINDENT# #UNINDENT# _rename_path ( path ) #NEWLINE# os . mkdir ( path ) #NEWLINE# os . mkdir ( os . path . join ( path , 'EGG-INFO' ) ) #NEWLINE# pkg_info = os . path . join ( path , 'EGG-INFO' , 'PKG-INFO' ) #NEWLINE# f = open ( pkg_info , 'w' ) #NEWLINE# try : #NEWLINE# #INDENT# f . write ( SETUPTOOLS_PKG_INFO ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# f . close ( ) #NEWLINE# #UNINDENT# return True