a hZk @s:dZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZmZmZdd lmZdd l mZdd lmZdd lmZdZddddddZddddddddddddedddddddddddddZer"dddd d!ded"<ddd#d$d!ded%<dZGd&d'd'eZdS)(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)purelibplatlibheadersscriptsdataz/$base/lib/python$py_version_short/site-packagesz;$platbase/$platlibdir/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez $base/binz$base/lib/pythonz$base/$platlibdir/pythonz$base/include/python/$dist_namez$base/site-packagesz$base/include/$dist_name) unix_prefix unix_homentpypypypy_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@seZdZdZgdZgdZer>edddefedddiZ d d Z d d Z d dZ ddZ ddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3efd4efd5efd6efd7d8d9fgZdS):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|j r\| |j r| }|j rt|j }tt|D]}|||d||<q|t|j |fd|j ttjjtj}ttjj|}tjtj|j}|jr|j r|js||vrtd|jdS)zRuns the command.rIz"Can't install when cross-compilingNz'writing list of installed files to '%s'zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r5Z run_commandrTZget_command_objZ plat_namer6r rget_sub_commandsrcreate_path_filer9 get_outputsr)rrangeexecutermaprJr`rrrPnormcaser-r4rri)r;Z build_platcmd_nameoutputsZroot_lenZcounterZsys_pathr-r<r<r=run2sD    z install.runcCsJtj|j|jd}|jr8|t||jgfd|n| d|dS)zCreates the .pth file.pthz creating %szpath file '%s' not createdN) rJr`rar_rr4rrrbrL)r;filenamer<r<r=r^s  zinstall.create_path_filecCshg}|D].}||}|D]}||vr"||q"q |jrd|jrd|tj|j |jd|S)z.Assembles the outputs of all the sub-commands.r) rget_finalized_commandrappendrr4rJr`rar_)r;rrcmdrr<r<r=rls    zinstall.get_outputscCs.g}|D]}||}||q |S)z*Returns the inputs of all the sub-commands)rrextend get_inputs)r;Zinputsrrr<r<r=r}s   zinstall.get_inputscCs|jp|jS)zSReturns true if the current distribution has any Python modules to install.)rTZhas_pure_modulesZhas_ext_modulesr:r<r<r=has_libs zinstall.has_libcCs |jS)zLReturns true if the current distribution has any headers to install.)rT has_headersr:r<r<r=rszinstall.has_headerscCs |jS)zMReturns true if the current distribution has any scripts to. install.)rT has_scriptsr:r<r<r=rszinstall.has_scriptscCs |jS)zJReturns true if the current distribution has any data to. install.)rTZhas_data_filesr:r<r<r=has_dataszinstall.has_datar-r,r.r/Zinstall_egg_infocCsdS)NTr<r:r<r<r=zinstall.) __name__ __module__ __qualname__ descriptionrjZboolean_optionsrXrrrkr>rdrMrNrOrqrrYr[r]r^rcr\rrrrrrrrZ sub_commandsr<r<r<r=rWsJ; N( " ,  r)__doc__rPrJZ distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr r r r Zsiter rrXZWINDOWS_SCHEMEryrzrr<r<r<r=sz           !