OwlCyberSecurity - MANAGER
Edit File: install.cpython-36.pyc
3 �Qg�j������������������@���s��d�Z�ddlZddlZddlmZ�ddlmZ�ddlmZ�ddl m Z �ddlmZ�ddl mZ�dd lmZmZmZ�dd lmZ�ddlmZ�ddlmZ�dd lmZ�dZdddddd�Zdddddd�dddddd�ed�Ze�rdddddd�ed <�ddd!d"dd�ed#<�d+ZG�d)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 $userbase�nt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez $userbase/bin� unix_userr���r���r���r���r���c���������������@���s:��e�Zd�ZdZd_d`dadbdddedfdgdidjdkdldmdndodpdqdrgZdd%d(gZer`ejd,dd-e�f��ejd,��d diZ d.d/��Z d0d1��Zd2d3��Zd4d5��Z d6d7��Zd8d9��Zd:d;��Zd<d=��Zd>d?��Zd@dA��ZdBdC��ZdDdE��ZdFdG��ZdHdI��ZdJdK��ZdLdM��ZdNdO��ZdPdQ��ZdRdS��ZdTdU��ZdVdW��ZdXefdYefdZefd[efd\d]d^��fgZdS�)s�installz'install everything from build directory�prefix=N�installation prefix�exec-prefix=�.(Unix only) prefix for platform-specific files�home=�+(Unix only) home directory to install under� install-base=�;base installation directory (instead of --prefix or --home)�install-platbase=z8base installation directory for platform-specific files z$(instead of --exec-prefix or --home)�root=�<install everything relative to this alternate root directory�install-purelib=�;installation directory for pure Python module distributions�install-platlib=�8installation directory for non-pure module distributions�install-lib=z4installation directory for all module distributions z3(overrides --install-purelib and --install-platlib)�install-headers=�(installation directory for C/C++ headers�install-scripts=�)installation directory for Python scripts� install-data=�%installation directory for data files�compile�c�compile .py to .pyc [default]� no-compile�don't compile .py files� optimize=�O�lalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]�force�f�1force installation (overwrite any existing files)� skip-build�2skip rebuilding everything (for testing/debugging)�record=�3filename in which to record list of installed files�userz!install in user site-package '%s'c�������������C���s����d|�_�d|�_d|�_d|�_d|�_d|�_d|�_d|�_d|�_d|�_ d|�_ d|�_d|�_t |�_t|�_d|�_d|�_d|�_d|�_d|�_d|�_d|�_d|�_d|�_d|�_dS�)zInitializes options.Nr�������)�prefix�exec_prefix�homer?����install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar ����install_userbaser����install_usersiter0����optimize� extra_path�install_path_filer8���� skip_build�warn_dir� build_base� build_lib�record)�self��rX����1/usr/lib64/python3.6/distutils/command/install.py�initialize_options����s2����zinstall.initialize_optionsc�������������C���sx��|�j�s|�js|�jr&|�js|�jr&td%��|�jr@|�j�s8|�jr@td��|�jrl|�j�sd|�jsd|�jsd|�jsd|�jrltd��tjdkr�|�jr�|�j d��d|�_|�j d��tjdkr�|�j���n|�j���|�j d ��t jj��d �}tdd�\}}y t j}W�n�tk r����d }Y�nX�|�jj��|�jj��|�jj��|dt jdd���dt jdd���|||||d�|�_t�rf|�j|�jd<�|�j|�jd<�|�j���|�j d��|�j|�jd<�|�j|�jd<�t�r�d dlm}�td��||�j��|�j ���|�j d��|�j�r�|�j!���|�j"dk�r�|�jj#�r�|�j$|�_"n|�j%|�_"|�j&dddddddd��|�j'���|�j"|�_(tj)j*|�j"|�j+�|�_"|�j,dk �r\|�j-d dddddd��|�j d!��|�j.d"d&d'��dS�)(zFinalizes options.z.must supply either prefix/exec-prefix/home or z)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}()r���rA���rB�����z%d.%d����z%d%d)Z dist_nameZdist_versionZ dist_fullname� py_version�py_version_short�py_version_nodotZ sys_prefixrA���Zsys_exec_prefixrB����abiflags�userbaseZusersitezpost-expand_basedirs()�base�platbase)�pprintzconfig vars:zpost-expand_dirs()�libr���r���r���r���r���Zlibbasezafter prepending root�buildrT���rU���zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not both)rT���rT���)rU���rU���)/rA���rB���rC���rD���rE���r���r?����os�name�warn� dump_dirs� finalize_unix�finalize_other�sys�version�splitr���ra����AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars� HAS_USER_SITErM���rN����expand_basedirsr���re����print�expand_dirs�create_home_pathrJ���Zext_modulesrH���rG���� convert_paths�handle_extra_path�install_libbase�path�join� extra_dirsrF����change_rootsZset_undefined_options)rW���r^���rA���rB���ra���re���rX���rX���rY����finalize_options����s������ zinstall.finalize_optionsc�������������C���s����t�sdS�ddlm}�tj|d���x||�jD�]r}|d�}|d�dkrN|dd ��}||�jkrz|�j|�}|j|�}t|�|��}n|j|�}t|�|�}tjd||��q*W�dS�) zDumps the list of user options.Nr���)� longopt_xlate�:r@����=z %s: %s���r����) r���Zdistutils.fancy_getoptr����r����debug�user_options�negative_opt� translate�getattr)rW����msgr�����optZopt_name�valrX���rX���rY���rk���u��s���� zinstall.dump_dirsc�������������C���sX��|�j�dk s|�jdk r\|�jdkr2|�jdkr2|�jdksP|�jdksP|�jdksP|�jdkrXtd��dS�|�j r�|�j dkrttd��|�j �|�_�|�_|�jd��n�|�j dk r�|�j �|�_�|�_|�jd��n�|�jdk�r&|�jdk r�td��ttd�p�tjtjk�r�dtjkr�d }nd }tjjtj�|�|�_tjjtj�|�|�_n|�jdk�r:|�j|�_|�j|�_�|�j|�_|�jd��dS�)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incompletez$User base directory is not specifiedr���r���z*must not supply exec-prefix without prefixZreal_prefix�RPM_BUILD_ROOTz/localr\���r���)rD���rE���rJ���rG���rH���rI���rK���rL���r���r?���rM���r���� select_schemerC���rA���rB����hasattrrn����base_prefixrh����environr}����normpath)rW���ZadditionrX���rX���rY���rl������sF���� zinstall.finalize_unixc�������������C���s����|�j�r8|�jdkrtd��|�j�|�_|�_|�jtjd���n�|�jdk r\|�j�|�_|�_|�jd��n\|�j dkrvtj jtj �|�_ |�j �|�_|�_y|�jtj��W�n"�t k r����tdtj���Y�nX�dS�)z)Finalizes options for non-posix platformsNz$User base directory is not specifiedZ_userr���z)I don't know how to install stuff on '%s')r?���rM���r���rD���rE���r����rh���ri���rC���rA���r}���r����rn����KeyError)rW���rX���rX���rY���rm������s"���� zinstall.finalize_otherc�������������C���s@���t�|�}x2tD�]*}d|�}t|�|�dkrt|�|||���qW�dS�)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSr�����setattr)rW���ri����scheme�keyZattrnamerX���rX���rY���r�������s ���� zinstall.select_schemec�������������C���s\���xV|D�]N}t�|�|�}|d�k rtjdks0tjdkr<tjj|�}t||�j�}t|�||��qW�d�S�)Nr[���r���)r����rh���ri���r}���� expanduserr ���rt���r����)rW����attrs�attrr����rX���rX���rY���� _expand_attrs���s���� zinstall._expand_attrsc�������������C���s���|�j�dddg��dS�)zNCalls `os.path.expanduser` on install_base, install_platbase and root.rD���rE���rF���N)r����)rW���rX���rX���rY���rv������s����zinstall.expand_basedirsc�������������C���s���|�j�ddddddg��dS�)z+Calls `os.path.expanduser` on install dirs.rG���rH���rJ���rI���rK���rL���N)r����)rW���rX���rX���rY���rx������s����zinstall.expand_dirsc�������������G���s0���x*|D�]"}d|�}t�|�|tt|�|����qW�dS�)z!Call `convert_path` over `names`.r����N)r����r���r����)rW����namesri���r����rX���rX���rY���rz������s���� zinstall.convert_pathsc�������������C���s����|�j�dkr|�jj�|�_�|�j�dk r�tjd��t|�j�t�rB|�j�jd�|�_�t|�j��dkr`|�j�d��}}n"t|�j��dkrz|�j�\}}ntd��t |�}nd}d}||�_ ||�_dS�) z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.�,r@���r���r]���zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr\���)rP���rr���r���rj���� isinstance�strrp����lenr���r���� path_filer���)rW���r����r���rX���rX���rY���r{������s$���� zinstall.handle_extra_pathc���������� ���G���s4���x.|D�]&}d|�}t�|�|t|�jt|�|����qW�dS�)z:Change the install directories pointed by name using root.r����N)r����r ���rF���r����)rW���r����ri���r����rX���rX���rY���r������s���� zinstall.change_rootsc�������������C���sh���|�j�s dS�ttjjd��}xH|�jj��D�]:\}}|j|�r&tjj|��r&|�j d|���tj |d��q&W�dS�)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i���)r?���r���rh���r}���r����rt����items� startswith�isdirZdebug_print�makedirs)rW���rC���ri���r}���rX���rX���rY���ry�����s����zinstall.create_home_pathc�������������C���s,��|�j�s6|�jd��|�jjd�j}|�jr6|t��kr6td��x|�j��D�]}|�j|��q@W�|�j r`|�j ���|�jr�|�j��}|�j r�t|�j �}x(tt|��D�]}||�|d��||<�q�W�|�jt|�j|fd|�j���ttjjtj�}ttjj|�}tjjtjj|�j��}|�j�r(|�j �o |�j��r(||k�r(tjd|�j��dS�)zRuns the command.rg���z"Can't install when cross-compilingNz'writing list of installed files to '%s'z�modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)rR���Zrun_commandrr���Zget_command_objZ plat_namerS���r���r����get_sub_commandsr�����create_path_filerV����get_outputsrF���r�����range�executer����maprh���r}���r����rn����normcaserJ���rQ���r���r����)rW���Z build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathrJ���rX���rX���rY����run(��s6���� zinstall.runc�������������C���sJ���t�jj|�j|�jd��}|�jr8|�jt||�jgfd|���n|�j d|���dS�)zCreates the .pth filez.pthzcreating %szpath file '%s' not createdN) rh���r}���r~���r|���r����rQ���r����r���r���rj���)rW����filenamerX���rX���rY���r����T��s���� zinstall.create_path_filec�������������C���sp���g�}x>|�j���D�]2}|�j|�}x"|j��D�]}||kr&|j|��q&W�qW�|�jrl|�jrl|jtjj|�j |�jd����|S�)z.Assembles the outputs of all the sub-commands.z.pth) r�����get_finalized_commandr�����appendr����rQ���rh���r}���r~���r|���)rW���r����r�����cmdr����rX���rX���rY���r����b��s���� zinstall.get_outputsc�������������C���s2���g�}x(|�j���D�]}|�j|�}|j|j����qW�|S�)z*Returns the inputs of all the sub-commands)r����r�����extend� get_inputs)rW���Zinputsr����r����rX���rX���rY���r����s��s ���� zinstall.get_inputsc�������������C���s���|�j�j��p|�j�j��S�)zSReturns true if the current distribution has any Python modules to install.)rr���Zhas_pure_modulesZhas_ext_modules)rW���rX���rX���rY����has_lib��s���� zinstall.has_libc�������������C���s ���|�j�j��S�)zLReturns true if the current distribution has any headers to install.)rr����has_headers)rW���rX���rX���rY���r�������s����zinstall.has_headersc�������������C���s ���|�j�j��S�)zMReturns true if the current distribution has any scripts to. install.)rr����has_scripts)rW���rX���rX���rY���r�������s����zinstall.has_scriptsc�������������C���s ���|�j�j��S�)zJReturns true if the current distribution has any data to. install.)rr���Zhas_data_files)rW���rX���rX���rY����has_data���s����zinstall.has_datarJ���rI���rK���rL���Zinstall_egg_infoc�������������C���s���dS�)NTrX���)rW���rX���rX���rY����<lambda>���s����zinstall.<lambda>)r���Nr���)r���Nr���)r���Nr���)r ���Nr!����\base installation directory for platform-specific files (instead of --exec-prefix or --home))r"���Nr����)r#���Nr$���)r%���Nr&���)r'���Nr(����ginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))r)���Nr����)r*���Nr+���)r,���Nr-���)r.���Nr/���)r0���r1���r2���)r3���Nr4���)r5���r6���r7���)r8���r9���r:���)r;���Nr<���)r=���Nr>���) �__name__� __module__�__qualname__Zdescriptionr����Zboolean_optionsru���r����r���r����rZ���r����rk���rl���rm���r����r����rv���rx���rz���r{���r����ry���r����r����r����r����r����r����r����r����Zsub_commandsrX���rX���rX���rY���r���I���s���������������������� N�3 ",r���)r���r���r���r���r���)�__doc__rn���rh���Z distutilsr���Zdistutils.corer���Zdistutils.debugr���Zdistutils.sysconfigr���Zdistutils.errorsr���Zdistutils.file_utilr���Zdistutils.utilr���r ���r ���r���r���Zsiter ���r���ru���ZWINDOWS_SCHEMEr����r����r���rX���rX���rX���rY����<module>���sV���