a cdhi@s&dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZmZmZdd lmZdd l mZdd lmZdd lmZdZddddddZddddddddddddedZerdddddded <ddd!d"dded#<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_name) unix_prefix unix_homentz $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$eZdZdZgdZgdZer>edddefedddiZ e e d d Z d d Z d dZddZddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Z d3d4Z!d5efd6efd7e fd8e!fd9d:d;fgZ"dS)<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.rHz"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_commandrSZget_command_objZ plat_namer6r rget_sub_commandsrcreate_path_filer9 get_outputsr)rrangeexecutermaprIr_rrrOnormcaser-r4rrh)r;Z build_platcmd_nameoutputsZroot_lenZcounterZsys_pathr-r<r<r=run#sD    z install.runcCsJtj|j|jd}|jr8|t||jgfd|n| d|dS)zCreates the .pth file.pthz creating %szpath file '%s' not createdN) rIr_r`r^rr4rrrarK)r;filenamer<r<r=rOs  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_commandrappendrr4rIr_r`r^)r;rrcmdrr<r<r=r]s    zinstall.get_outputscCs.g}|D]}||}||q |S)z*Returns the inputs of all the sub-commands)rrextend get_inputs)r;Zinputsrrr<r<r=rns   zinstall.get_inputscCs|jp|jS)zSReturns true if the current distribution has any Python modules to install.)rSZhas_pure_modulesZhas_ext_modulesr:r<r<r=has_libzs zinstall.has_libcCs |jS)zLReturns true if the current distribution has any headers to install.)rS has_headersr:r<r<r=rszinstall.has_headerscCs |jS)zMReturns true if the current distribution has any scripts to. install.)rS has_scriptsr:r<r<r=rszinstall.has_scriptscCs |jS)zJReturns true if the current distribution has any data to. install.)rSZhas_data_filesr:r<r<r=has_dataszinstall.has_datar-r,r.r/Zinstall_egg_infocCsdS)NTr<r:r<r<r=zinstall.)#__name__ __module__ __qualname__ descriptionriZboolean_optionsrWrrrjrl sysconfigr!r>rcrLrMrNrqrrXrZr\r]rbr[rrrrrrrrZ sub_commandsr<r<r<r=rJsL;  N*  " ,  r)__doc__rOrrIZ distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr r r r Zsiter rrWZWINDOWS_SCHEMErvrwrr<r<r<r=sd