B  š !\Z×Ìã@sdZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZmZmZdd lmZdd l mZdd lmZdd lmZdZddddddœZddddddœddddddœedœZerddddddœed <ddd!d"ddœed#<dZGd$d%„d%eƒZdS)&zFdistutils.command.install Implements the Distutils 'install' command.éN)Úlog)ÚCommand)ÚDEBUG)Úget_config_vars)ÚDistutilsPlatformError)Ú write_file)Ú convert_pathÚ subst_varsÚ change_root)Ú get_platform)ÚDistutilsOptionError)Ú USER_BASE)Ú USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez $base/Scriptsz$base)ÚpurelibÚplatlibÚheadersÚscriptsÚdataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez $base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)Ú unix_prefixÚ unix_homeÚntz $usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz $userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez $userbase/binÚ unix_userc@s:eZdZdZdddddddd d d d d ddddddgZdddgZer`e dddef¡e d¡ddiZ dd„Z dd„Z dd „Z d!d"„Z d#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„Zd7d8„Zd9d:„Zd;d<„Zd=d>„Zd?d@„ZdAdB„ZdCdD„ZdEefdFefdGefdHefdIdJdK„fgZdS)LÚinstallz'install everything from build directory)zprefix=Nzinstallation prefix)z exec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz/opt/alt/python37/lib64/python3.7/distutils/command/install.pyÚinitialize_options’s2 zinstall.initialize_optionsc Csx|js|js|jr&|js|jr&tdƒ‚|jr@|js8|jr@tdƒ‚|jrl|jsd|jsd|jsd|jsd|jrltdƒ‚tjdkrŒ|jrŒ|  d¡d|_|  d¡tjdkrª|  ¡n|  ¡|  d¡t j ¡d }td d ƒ\}}y t j}Wntk rúd }YnX|j ¡|j ¡|j ¡|d t jdd…dt jdd…|||||dœ |_trf|j|jd<|j|jd<| ¡|  d¡|j|jd<|j|jd<tr´d dlm}tdƒ||jƒ|  ¡|  d¡|jrÖ| !¡|j"dkrþ|jj#rö|j$|_"n|j%|_"| &dddddddd¡| '¡|j"|_(tj) *|j"|j+¡|_"|j,dk r\| -ddddddd¡|  d ¡| .d!d"d#¡dS)$zFinalizes options.zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)baseÚposixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr r!Úz%d.%déz%d%d) Z dist_nameZ dist_versionZ dist_fullnameÚ py_versionZpy_version_shortZpy_version_nodotZ sys_prefixr Zsys_exec_prefixr!ÚabiflagsÚuserbaseZusersitezpost-expand_basedirs()ÚbaseZplatbase)Úpprintz config vars:zpost-expand_dirs()ÚlibrrrrrZlibbasezafter prepending rootÚbuild)r3r3)r4r4)/r r!r"r#r$r rÚosÚnameÚwarnÚ dump_dirsÚ finalize_unixÚfinalize_otherÚsysÚversionÚsplitrr>ÚAttributeErrorÚ distributionZget_nameZ get_versionZ get_fullnameÚ version_infoÚ config_varsÚ HAS_USER_SITEr,r-Úexpand_basedirsrrAÚprintÚ expand_dirsÚcreate_home_pathr)Z ext_modulesr'r&Ú convert_pathsÚhandle_extra_pathÚinstall_libbaseÚpathÚjoinÚ extra_dirsr%Ú change_rootsZset_undefined_options)r6r=r r!r>rAr7r7r8Úfinalize_optionsàsˆ                           zinstall.finalize_optionscCs¤tsdSddlm}t |d¡x||jD]r}|d}|ddkrN|dd…}||jkrz|j|}| |¡}t||ƒ }n| |¡}t||ƒ}t d||¡q*WdS)zDumps the list of user options.Nr)Ú longopt_xlateú:éÿÿÿÿú=z %s: %s) rZdistutils.fancy_getoptr^rÚdebugÚ user_optionsÚ negative_optÚ translateÚgetattr)r6Úmsgr^ZoptZopt_nameÚvalr7r7r8rGus         zinstall.dump_dirscCs"|jdk s|jdk r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtdƒ‚dS|j rŽ|j dkrtt dƒ‚|j |_|_|  d¡n|j dk r²|j |_|_|  d¡nl|jdkrð|jdk rÎtdƒ‚tj tj¡|_tj tj¡|_n|jdkr|j|_|j|_|j|_|  d¡dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incompletez$User base directory is not specifiedrrz*must not supply exec-prefix without prefixr)r#r$r)r&r'r(r*r+r rr,rÚ select_schemer"r r!rDrYÚnormpathrJ)r6r7r7r8rHˆs<             zinstall.finalize_unixcCs¼|jr8|jdkrtdƒ‚|j|_|_| tjd¡n€|jdk r\|j|_|_| d¡n\|j dkrvtj   t j ¡|_ |j |_|_y| tj¡Wn"t k r¶tdtjƒ‚YnXdS)z)Finalizes options for non-posix platformsNz$User base directory is not specifiedZ_userrz)I don't know how to install stuff on '%s')rr,rr#r$rirDrEr"r rYrjrJÚKeyError)r6r7r7r8rI°s"    zinstall.finalize_othercCs@t|}x2tD]*}d|}t||ƒdkrt||||ƒqWdS)z=Sets the install directories by applying the install schemes.Úinstall_N)ÚINSTALL_SCHEMESÚ SCHEME_KEYSrfÚsetattr)r6rEZschemeÚkeyZattrnamer7r7r8riÆs  zinstall.select_schemecCs\xV|D]N}t||ƒ}|dk rtjdks0tjdkr| ¡D]2}| |¡}x"| ¡D]}||kr&| |¡q&WqW|jrl|jrl| tj |j |jd¡¡|S)z.Assembles the outputs of all the sub-commands.z.pth) rÚget_finalized_commandrÚappendryr0rDrYrZrX)r6r‡r†Úcmdr‰r7r7r8rWs  zinstall.get_outputscCs2g}x(| ¡D]}| |¡}| | ¡¡qW|S)z*Returns the inputs of all the sub-commands)rrŠÚextendÚ get_inputs)r6Zinputsr†rŒr7r7r8rŽhs  zinstall.get_inputscCs|j ¡p|j ¡S)zSReturns true if the current distribution has any Python modules to install.)rNZhas_pure_modulesZhas_ext_modules)r6r7r7r8Úhas_libts zinstall.has_libcCs |j ¡S)zLReturns true if the current distribution has any headers to install.)rNÚ has_headers)r6r7r7r8rzszinstall.has_headerscCs |j ¡S)zMReturns true if the current distribution has any scripts to. install.)rNÚ has_scripts)r6r7r7r8r‘szinstall.has_scriptscCs |j ¡S)zJReturns true if the current distribution has any data to. install.)rNZhas_data_files)r6r7r7r8Úhas_data„szinstall.has_datar)r(r*r+Zinstall_egg_infocCsdS)NTr7)r6r7r7r8Úózinstall.) Ú__name__Ú __module__Ú __qualname__Z descriptionrcZboolean_optionsrQr‹rrdr9r]rGrHrIrirsrRrTrVrWr\rUrˆr€rrŽrrr‘r’Z sub_commandsr7r7r7r8rIsh    N(  " , r)Ú__doc__rJrDZ distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr r r r Zsiter rrQZWINDOWS_SCHEMErmrnrr7r7r7r8ÚsV