a „oe7 ã@sPddlmZddlmmZddlZddlZddlm Z Gdd„dejƒZdS)é)ÚlogNé)Úensure_directoryc@s2eZdZdZdd„Zdd„Zdd„Zd d d „Zd S) Úinstall_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj |¡d|_dS)NF)ÚorigrÚinitialize_optionsÚno_ep©Úself©r úCC:\Program Files\Certbot\pkgs\setuptools\command\install_scripts.pyr s z"install_scripts.initialize_optionscCs<| d¡|jjr tj |¡ng|_|jr0dS| ¡dS)NÚegg_info) Z run_commandZ distributionZscriptsrrÚrunÚoutfilesrÚ_install_ep_scriptsr r r r rs zinstall_scripts.runc Cs¬ddlm}m}ddlm}| d¡}||j||j|jƒ|j|j ƒ}| d¡}t |ddƒ}|j }|t j krp|g}| ¡}|j ¡ |¡} | ||  ¡¡D]} |j| Žq˜dS)Nr)Ú DistributionÚ PathMetadataé)Ú easy_installr Z build_scriptsÚ executable)Z pkg_resourcesrrÚrZget_finalized_commandZegg_baser Zegg_nameZ egg_versionÚgetattrZ ScriptWriterÚsysrZbestZcommand_spec_classZ from_paramÚget_argsZ as_headerÚ write_script) r rrZeiZei_cmdZdistZbs_cmdZ exec_paramÚwriterÚcmdÚargsr r r rs$   ü   z#install_scripts._install_ep_scriptsÚ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)Zsetuptools.command.easy_installrr rÚinfoZ install_dirÚosÚpathÚjoinrÚappendÚdry_runrÚopenÚwriteÚclose) r Ú script_nameÚcontentsÚmodeZignoredrr ÚtargetÚmaskÚfr r r r4s  zinstall_scripts.write_scriptN)r)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrr r r r r s  r) Z distutilsrZ!distutils.command.install_scriptsZcommandrrr#rÚ_pathrr r r r Ús