
|«‘_{  ã               @   sŠ   d  d l  m Z m Z d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m	 Z	 d  d l
 Z
 Gd d „  d e j e ƒ Z d S)é    )ÚlogÚdir_utilN)ÚCommand)Ú
namespaces)Úunpack_archivec               @   sa   e  Z d  Z d Z d Z d g Z d d „  Z d d „  Z d	 d
 „  Z d d „  Z	 d d „  Z
 d S)Úinstall_egg_infoz.Install an .egg-info directory for the packageúinstall-dir=Údúdirectory to install toc             C   s   d  |  _  d  |  _ d  |  _ d  S)N)Úinstall_dirÚinstall_layoutÚprefix_option)Úself© r   úI/tmp/pip-build-3_sjtvrs/setuptools/setuptools/command/install_egg_info.pyÚinitialize_options   s    		z#install_egg_info.initialize_optionsc             C   s6  |  j  d d ƒ |  j  d d ƒ t j d k r? |  j  d d ƒ |  j d ƒ } t j d  d  | j | j ƒ j ƒ  d } |  j rÎ |  j j	 ƒ  d k r  t
 d
 ƒ ‚ |  j j	 ƒ  |  _ | j d t j d ƒ } n4 |  j sd t j k ré n | j d t j d ƒ } | j |  _ t j j |  j | ƒ |  _ g  |  _ d  S)NÚinstall_libr   Úinstallr   i  r   Úegg_infoz	.egg-infoÚdebz"unknown value for --install-layoutz-py%sÚ Úreal_prefix)r   r   )r   r   )r   r   )r   )Úset_undefined_optionsÚsysÚ
hexversionÚget_finalized_commandÚpkg_resourcesÚDistributionÚegg_nameZegg_versionr   ÚlowerÚDistutilsOptionErrorÚreplaceÚPY_MAJORr   Ú__dict__r   ÚsourceÚosÚpathÚjoinr   ÚtargetÚoutputs)r   Zei_cmdÚbasenamer   r   r   Úfinalize_options   s(    		z!install_egg_info.finalize_optionsc             C   sÙ   |  j  d ƒ t j j |  j ƒ rT t j j |  j ƒ rT t j |  j d |  j ƒn8 t j j	 |  j ƒ rŒ |  j
 t j |  j f d |  j ƒ |  j s¥ t j |  j ƒ |  j
 |  j f  d |  j |  j f ƒ |  j ƒ  d  S)Nr   Údry_runz	Removing zCopying %s to %s)Úrun_commandr%   r&   Úisdirr(   Úislinkr   Úremove_treer,   ÚexistsÚexecuteÚunlinkr   Úensure_directoryÚcopytreer$   Zinstall_namespaces)r   r   r   r   Úrun2   s    +#	 zinstall_egg_info.runc             C   s   |  j  S)N)r)   )r   r   r   r   Úget_outputs?   s    zinstall_egg_info.get_outputsc                s,   ‡  f d d †  } t  ˆ  j ˆ  j | ƒ d  S)Nc                s“   x1 d D]) } |  j  | ƒ s, d | |  k r d  Sq Wˆ  j rl ˆ  j d	 k rl |  j  d ƒ rl t j d ƒ d  Sˆ  j j | ƒ t j d |  | ƒ | S)
Nú.svn/úCVS/ú/r   zSOURCES.txtzSkipping SOURCES.txtzCopying %s to %s)r8   r9   )r   )Ú
startswithr   r   Úinfor)   ÚappendÚdebug)ÚsrcÚdstÚskip)r   r   r   ÚskimmerD   s    'z*install_egg_info.copytree.<locals>.skimmer)r   r$   r(   )r   rB   r   )r   r   r5   B   s    zinstall_egg_info.copytreeN)r   r	   r
   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdescriptionÚuser_optionsr   r+   r6   r7   r5   r   r   r   r   r   
   s   	r   )Ú	distutilsr   r   r%   r   Ú
setuptoolsr   r   Zsetuptools.archive_utilr   r   Z	Installerr   r   r   r   r   Ú<module>   s   