a
    e0h                     @   s   d Z ddl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
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ erddlmZmZmZ ddlmZ ddlmZ eeZG dd deZ dd Z!dS )z6Legacy installation process, i.e. `setup.py install`.
    N)change_root)InstallationError)
indent_log)
ensure_dir)make_setuptools_install_args)runner_with_spinner_message)TempDirectory)MYPY_CHECK_RUNNING)ListOptionalSequence)BuildEnvironment)Schemec                   @   s   e Zd Zdd ZdS )LegacyInstallFailurec                 C   s   t  | _d S N)sysexc_infoparent)self r   U/var/www/auris/lib/python3.9/site-packages/pip/_internal/operations/install/legacy.py__init__   s    zLegacyInstallFailure.__init__N)__name__
__module____qualname__r   r   r   r   r   r      s   r   c                    s>  |j }tdd}ztj|jd}t||| | |||||	|d}td|
}t @ | |||d W d    n1 s0    Y  W d    n1 s0    Y  tj	|st
d| W W d    dS W n ty   tY n0 t|}|  }W d    n1 s0    Y  W d    n1 s80    Y   fd	d
}|D ],}tj|}|drR||} qqRd|}t|g }|D ]@}| }tj|r|tjj7 }|tj||| q|  t| tj|d}t|d$}|d|d  W d    n1 s00    Y  dS )Nrecord)kindzinstall-record.txt)
global_optionsinstall_optionsrecord_filenamerootprefix
header_dirhomeuse_user_siteno_user_config	pycompilezRunning setup.py install for {})cmdcwdzRecord file %s not foundFc                    s&    d u st j| s| S t | S d S r   )ospathisabsr   )r*   r    r   r   prepend_root`   s    zinstall.<locals>.prepend_rootz	.egg-infoz{} did not indicate that it installed an .egg-info directory. Only setup.py projects generating .egg-info directories are supported.zinstalled-files.txtw
T)headersr   r)   r*   joinr   r   formatr   existsloggerdebug	Exceptionr   openread
splitlinesdirnameendswithr   stripisdirsepappendrelpathsortr   write)r   r   r    r#   r!   r$   r&   schemesetup_py_pathisolatedreq_name	build_envunpacked_source_directoryreq_descriptionr"   temp_dirr   install_argsrunnerfrecord_linesr-   line	directoryegg_info_dirmessage	new_linesfilenameinst_files_pathr   r,   r   install!   sr    B

L
4rV   )"__doc__loggingr)   r   distutils.utilr   pip._internal.exceptionsr   pip._internal.utils.loggingr   pip._internal.utils.miscr   $pip._internal.utils.setuptools_buildr   pip._internal.utils.subprocessr   pip._internal.utils.temp_dirr   pip._internal.utils.typingr	   typingr
   r   r   pip._internal.build_envr   pip._internal.models.schemer   	getLoggerr   r4   r6   r   rV   r   r   r   r   <module>   s$   
