o ~›Re! ã@sdddlmZddlmmZddlmZddlZddl Z ddl m Z m Z m Z Gdd„dejƒZdS)é)ÚlogN)ÚDistutilsModuleError)Ú DistributionÚ PathMetadataÚensure_directoryc@s*eZdZdZdd„Zdd„Zd dd„Zd S) Úinstall_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj |¡d|_dS)NF)ÚorigrÚinitialize_optionsÚno_ep)Úself©r ú›/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/install_scripts.pyr s  z"install_scripts.initialize_optionsc Csddlmm}| d¡|jjrtj |¡ng|_ |j r!dS|  d¡}t |j t|j |jƒ|j|jƒ}|  d¡}t|ddƒ}z |  d¡}t|ddƒ}Wn ttfyZd}Ynw|j}|red}|j}|tjkrm|g}| ¡}|j ¡ |¡} | ||  ¡¡D]} |j| ŽqdS) NrÚegg_infoÚ build_scriptsÚ executableZ bdist_wininstZ _is_runningFz python.exe)Úsetuptools.command.easy_installÚcommandÚ easy_installÚ run_commandÚ distributionÚscriptsrrÚrunÚoutfilesr Úget_finalized_commandrZegg_baserrÚegg_nameZ egg_versionÚgetattrÚ ImportErrorrZ ScriptWriterZWindowsScriptWriterÚsysrÚbestZcommand_spec_classÚ from_paramÚget_argsZ as_headerÚ write_script) r ÚeiZei_cmdÚdistZbs_cmdZ exec_paramZbw_cmdZ is_wininstÚwriterÚcmdÚargsr r r rs>  þ   ÿ  ÿzinstall_scripts.runÚtc Gs†ddlm}m}t d||j¡tj |j|¡}|j   |¡|ƒ}|j sAt |ƒt |d|ƒ} |  |¡|  ¡||d|ƒdSdS)z1Write an executable file to the scripts directoryr)ÚchmodÚ current_umaskzInstalling %s script to %sÚwiÿN)rr(r)rÚinfoZ install_dirÚosÚpathÚjoinrÚappendÚdry_runrÚopenÚwriteÚclose) r Ú script_nameÚcontentsÚmodeZignoredr(r)ÚtargetÚmaskÚfr r r r!7s  ûzinstall_scripts.write_scriptN)r')Ú__name__Ú __module__Ú __qualname__Ú__doc__r rr!r r r r r s &r)Ú distutilsrZ!distutils.command.install_scriptsrrrÚdistutils.errorsrr,rÚ pkg_resourcesrrrr r r r Ús