3
­?d]H  ã               @   sn   d dl mZmZmZ d dlZdejkr8d dljjZ	dZ
nd dljjZ	dZ
d dlmZ e	jZG dd„ deƒZdS )	é    )ÚdivisionÚabsolute_importÚprint_functionNÚ
setuptoolsTF)Ú
write_filec               @   s8   e Zd Zejddd„ fg Zdd„ Zdd„ Zdd	„ Zd
S )ÚinstallZinstall_clibc             C   s   dS )NT© )Úxr   r   ú@/tmp/pip-build-op5p2y5_/numpy/numpy/distutils/command/install.pyÚ<lambda>   s    zinstall.<lambda>c             C   s   t j| ƒ | j| _d S )N)Úold_installÚfinalize_optionsÚinstall_libbaseÚinstall_lib)Úselfr   r   r
   r      s    
zinstall.finalize_optionsc             C   sj   ddl m} | js| jr"|j| ƒS tjdƒ}|jjddƒ}|j	j
}|dksR|dkr^|j| ƒ n| jƒ  dS )	zÌ The setuptools version of the .run() method.

        We must pull in the entire code so we can override the level used in the
        _getframe() call since we wrap this call by one more level.
        r   )r   é   Ú__name__Ú zdistutils.distÚrun_commandsN)Údistutils.command.installr   Zold_and_unmanageableZ!single_version_externally_managedÚrunÚsysÚ	_getframeÚ	f_globalsÚgetÚf_codeÚco_nameZdo_egg_install)r   Zdistutils_installZcallerZcaller_moduleZcaller_namer   r   r
   Úsetuptools_run   s    


zinstall.setuptools_runc             C   s”   t stj| ƒ}n| jƒ }| jr�t| jdƒ�B}g }d}x2|D ]*}|jƒ }d|krZd}d| }|j|ƒ q:W W d Q R X |r�| jt	| j|fd| j ƒ |S )NÚrFú Tz"%s"z*re-writing list of installed files to '%s')
Úhave_setuptoolsr   r   r   ÚrecordÚopenÚrstripÚappendÚexecuter   )r   r   ÚfÚlinesZneed_rewriteÚlr   r   r
   r   :   s&    

zinstall.runN)r   Ú
__module__Ú__qualname__r   Úsub_commandsr   r   r   r   r   r   r
   r      s
    r   )Ú
__future__r   r   r   r   ÚmodulesZsetuptools.command.installÚcommandr   Zold_install_modr    r   Údistutils.file_utilr   r   r   r   r   r
   Ú<module>   s   
