a (š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-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/install_scripts.pyr s z"install_scripts.initialize_optionsc Csddlmm}| d¡|jjr2tj |¡ng|_ |j rBdS|  d¡}t |j t|j |jƒ|j|jƒ}|  d¡}t|ddƒ}z|  d¡}t|ddƒ}Wnttfy´d}Yn0|j}|rÊd}|j}|tjkrÚ|g}| ¡}|j ¡ |¡} | ||  ¡¡D]} |j| ŽqdS) NrÚegg_infoÚ build_scriptsÚ executableÚ 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 s~t |ƒt |d|ƒ} |  |¡|  ¡||d|ƒdS)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