B
ÎÕ¶ƒŒy´ã @ sd d dl mZ d dlm mZ d dlmZ d dlZd dl Z d dl
mZmZm
Z
G dd„ dejƒZdS )é )ÚlogN)ÚDistutilsModuleError)ÚDistributionÚPathMetadataÚensure_directoryc @ s* e Zd ZdZdd„ Zdd„ Zd
dd„Zd S )Úinstall_scriptsz;Do normal script install, plus any egg_info wrapper scriptsc C s t j | ¡ d| _d S )NF)Úorigr Úinitialize_optionsÚno_ep)Úself© r ú˜/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el9.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/install_scripts.pyr
s z"install_scripts.initialize_optionsc C s dd l m m} | d¡ | jjr2tj | ¡ ng | _ | j
rBd S | d¡}t|j
t|j
|jƒ|j|jƒ}| d¡}t|dd ƒ}y| d¡}t|ddƒ}W n ttfk
r¶ d}Y nX |j}|rÌd}|j}|tjkrÜ|g}| ¡ }|j ¡ |¡} x$| || ¡ ¡D ]}
| j|
Ž qW d S ) Nr Úegg_infoÚ
build_scriptsÚ
executableÚ
bdist_wininstZ_is_runningFz
python.exe)Úsetuptools.command.easy_installÚcommandÚeasy_installÚrun_commandÚdistributionÚscriptsr r ÚrunÚoutfilesr
Úget_finalized_commandr Zegg_baser r Úegg_nameZegg_versionÚgetattrÚImportErrorr ZScriptWriterZWindowsScriptWriterÚsysr ÚbestZcommand_spec_classÚ
from_paramZget_argsZ as_headerÚwrite_script)r ÚeiZei_cmdÚdistZbs_cmdZ
exec_paramZbw_cmdZ
is_wininstÚwriterÚcmdÚargsr r r
r s8
zinstall_scripts.runÚtc
G s‚ ddl m}m} t d|| j¡ tj | j|¡}| j
|¡ |ƒ }| js~t|ƒ t
|d| ƒ} | |¡ | ¡ ||d| ƒ dS )z1Write an executable file to the scripts directoryr )ÚchmodÚ
current_umaskzInstalling %s script to %sÚwiÿ N)r r( r) r ÚinfoZinstall_dirÚosÚpathÚjoinr ÚappendÚdry_runr ÚopenÚwriteÚclose)
r Úscript_nameÚcontentsÚmodeZignoredr( r) ÚtargetÚmaskÚfr r r
r! 7 s
zinstall_scripts.write_scriptN)r' )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r! r r r r
r
s &r )Ú distutilsr Z!distutils.command.install_scriptsr r r Údistutils.errorsr r, r Ú
pkg_resourcesr r r r r r r
Ú