CasperSecurity

Current Path : /lib/python3.10/distutils/command/__pycache__/
Upload File :
Current File : //lib/python3.10/distutils/command/__pycache__/install.cpython-310.pyc

o

��bcRx�
@sdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlmZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZeduZdZiiid�Zdddddddddd�	ed<dddddddddd�	ed<eD]"Zd D]\ZZ eZ!ej"e Z#ed!kr�ee#vr�d"Z!e#e!eee<q�q�eD]=Z$ee$�%�D]4\ZZ&e�'d#d$e&�Z&e&�(d%d&�Z&e&�(d'd(�Z&ed!kr�e&d)7Z&ej)d*kr�ed+kr�e&�(d,d-�Z&e&ee$e<q�q�er�d.d.d/d0d1d�ed2<d.d.d3d4d1d�ed5<Gd6d7�d7e�Z*dS)8zFdistutils.command.install

Implements the Distutils 'install' command.�N)�log)�Command)�DEBUG)�get_config_vars�is_virtual_environment)�DistutilsPlatformError)�
write_file)�convert_path�
subst_vars�change_root)�get_platform)�DistutilsOptionError)�	USER_BASE)�	USER_SITE)�purelib�platlib�headers�scripts�data)�unix_prefix�	unix_home�ntz6{installed_base}/{platlibdir}/python{py_version_short}z0{platbase}/{platlibdir}/python{py_version_short}z7{base}/local/lib/python{py_version_short}/dist-packageszD{platbase}/local/{platlibdir}/python{py_version_short}/dist-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z7{base}/local/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z{base}/local/binz{base}/local)	�stdlib�
platstdlibrr�includer�platincluderr�
unix_localz {base}/lib/python3/dist-packagesz-{platbase}/{platlibdir}/python3/dist-packagesz
{base}/binz{base}�
deb_system))r�posix_prefix)r�
posix_home)rrrrz	\{(.+?)\}z$\g<1>z$installed_basez$basez$py_version_nodot_platz$py_version_nodotz/$dist_name)��	rz/lib/z
/$platlibdir/z	$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_userc@seZdZdZgd�Zgd�Zere�dddef�e�d�ddiZ	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3efd4efd5efd6efd7d8d9�fgZdS):�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<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z
install-data=Nz%installation directory for data files)�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz1force installation (overwrite any existing files))�
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed files)zinstall-layout=Nz7installation layout to choose (known values: deb, unix))r%r)r+�userNz!install in user site-package '%s'r'r%cCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
tr2t|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)zInitializes options.Nr�)�prefix�exec_prefix�homer,�
prefix_option�install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_data�
HAS_USER_SITEr�install_userbaser�install_usersite�install_layout�	multiarchr%�optimize�
extra_path�install_path_filer)�
skip_build�warn_dir�
build_base�	build_lib�record��self�rJ�0/usr/lib/python3.10/distutils/command/install.py�initialize_options�s:
zinstall.initialize_optionsc
Cs�|js	|js	|jr|js|jrtd��|jr |js|jr td��|jr6|js2|js2|js2|js2|jr6td��tjdkrF|jrF|�	d�d|_|�
d�tjdkrU|��n|��|�
d�t
j��d	}td
d�\}}zt
j}Wnty|d}Ynw|j��|j��|j��|d
t
jdd�dt
jdd�|||||t
jd�|_tr�|j|jd<|j|jd<t�d�r�t�d�|jd<|� �|�
d�|j|jd<|j|jd<t!r�d	dl"m"}t#d�||j�|�$�|�
d�|jr�|�%�|j&du�r
|jj'�r|j(|_&n|j)|_&|�*dddddd �t�r|�*dd�|�+�|j&|_,tj-�.|j&|j/�|_&|j0du�r@|�1d!dddddd �|�
d"�|�2d#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)�	dist_name�dist_version�
dist_fullname�
py_version�py_version_short�py_version_nodot�
sys_prefixr.�sys_exec_prefixr/�abiflags�
platlibdir�userbase�usersiteT�srcdirzpost-expand_basedirs()�base�platbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrr�libbasezafter prepending root�build)rErE)rFrF)3r.r/r0r2r3r
r,�os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrrX�AttributeError�distribution�get_name�get_version�get_fullname�version_inforY�config_varsr;r<r=�	sysconfig�is_python_build�get_config_var�expand_basedirsrr_�print�expand_dirs�create_home_pathr8�ext_modulesr6r5�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsr4�change_roots�set_undefined_options)rIrSr.r/rXr_rJrJrK�finalize_optionss�������







��






��
�zinstall.finalize_optionscCs�tsdSddlm}t�|d�|jD]9}|d}|ddkr&|dd�}||jvr<|j|}|�|�}t||�}n
|�|�}t||�}t�d||�qdS)zDumps the list of user options.Nr)�
longopt_xlate�:����=z  %s: %s)	r�distutils.fancy_getoptr�r�debug�user_options�negative_opt�	translate�getattr)rI�msgr��opt�opt_name�valrJrJrKrf�s 





�zinstall.dump_dirscCs�|jdus
|jdur.|jdur|jdur|jdus(|jdus(|jdus(|jdur,td��dS|j	rH|j
dur:td��|j
|_|_|�d�dS|j
dur[|j
|_|_|�d�dS|j|_|jdur~|jdurmtd��tj�tj�|_tj�tj�|_n	|jdur�|j|_|j|_|j|_|jr�|j��dvr�ddl}|�d	�|_|�d
�dS|j��dvr�|�d�dStd
��|jr�tj�|j�dks�t�r�|�d�dStj�|j�dkr�d|_|_d|_|_|�d�dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete�$User base directory is not specifiedr#rz*must not supply exec-prefix without prefix)�debr�	MULTIARCHr)�unixrz"unknown value for --install-layoutz
/usr/localz/usrr)r2r3r8r5r6r7r9r:r
r,r<r�
select_schemer0r.r1r/rcr~�normpathrir>�lowerrsrur?r)rIrsrJrJrKrg�sh





�
�


�
��zinstall.finalize_unixcCs�|jr|jdurtd��|j|_|_|�tjd�dS|jdur0|j|_|_|�d�dS|j	dur=tj
�tj	�|_	|j	|_|_z	|�tj�WdSt
y[tdtj��w)z)Finalizes options for non-posix platformsNr��_userrz)I don't know how to install stuff on '%s')r,r<rr2r3r�rcrdr0r.r~r�ri�KeyErrorrHrJrJrKrh�s(
�

��zinstall.finalize_othercCs<t|}tD]}d|}t||�durt||||�qdS)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSr��setattr)rIrd�scheme�key�attrnamerJrJrKr�s��zinstall.select_schemecCsX|D]'}t||�}|dur)tjdkstjdkrtj�|�}t||j�}t|||�qdS)NrMr)r�rcrdr~�
expanduserr
rrr�)rI�attrs�attrr�rJrJrK�
_expand_attrss
��zinstall._expand_attrscC�|�gd��dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.)r2r3r4N�r�rHrJrJrKrv"szinstall.expand_basedirscCr�)z+Calls `os.path.expanduser` on install dirs.)r5r6r8r7r9r:Nr�rHrJrJrKrx'szinstall.expand_dirscGs,|D]}d|}t||tt||���qdS)z!Call `convert_path` over `names`.r�N)r�r	r��rI�namesrdr�rJrJrKr{-s�zinstall.convert_pathscCs�|jdur
|jj|_|jdurFt�d�t|jt�r!|j�d�|_t|j�dkr0|jd}}nt|j�dkr=|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-rrOzY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsrN)rArmrre�
isinstance�strrk�lenr
r	�	path_filer�)rIr�r�rJrJrKr|3s(


��

zinstall.handle_extra_pathc	Gs0|D]}d|}t||t|jt||���qdS)z:Change the install directories pointed by name using root.r�N)r�rr4r�r�rJrJrKr�Us�zinstall.change_rootscCsb|jsdSttj�d��}|j��D]\}}|�|�r.tj�|�s.|�	d|�t�
|d�qdS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�)r,r	rcr~r�rr�items�
startswith�isdir�debug_print�makedirs)rIr0rdr~rJrJrKry[s��zinstall.create_home_pathcCs&|js|�d�|j�d�j}|jr|t�krtd��|��D]}|�|�q|j	r.|�
�|jr]|��}|j
rPt|j
�}tt|��D]}|||d�||<qC|�t|j|fd|j�ttjjtj�}ttjj|�}tj�tj�|j��}|jr�|j	r�|js�||vr�t�d|j�dSdSdSdS)zRuns the command.rbz"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)rC�run_commandrm�get_command_obj�	plat_namerDrr�get_sub_commandsr��create_path_filerG�get_outputsr4r��range�executer�maprcr~r�ri�normcaser8rBrr�)rI�
build_plat�cmd_name�outputs�root_len�counter�sys_pathr8rJrJrK�rungsH

�������zinstall.runcCsLtj�|j|jd�}|jr|�t||jgfd|�dS|�	d|�dS)zCreates the .pth file�.pthzcreating %szpath file '%s' not createdN)
rcr~rr}r�rBr�rr�re)rI�filenamerJrJrKr��s
�
�zinstall.create_path_filecCshg}|��D]}|�|�}|��D]}||vr|�|�qq|jr2|jr2|�tj�|j	|jd��|S)z.Assembles the outputs of all the sub-commands.r�)
r��get_finalized_commandr��appendr�rBrcr~rr})rIr�r��cmdr�rJrJrKr��s

���zinstall.get_outputscCs.g}|��D]}|�|�}|�|���q|S)z*Returns the inputs of all the sub-commands)r�r��extend�
get_inputs)rI�inputsr�r�rJrJrKr��s

zinstall.get_inputscCs|j��p	|j��S)zSReturns true if the current distribution has any Python
        modules to install.)rm�has_pure_modules�has_ext_modulesrHrJrJrK�has_lib�s
�zinstall.has_libcC�
|j��S)zLReturns true if the current distribution has any headers to
        install.)rm�has_headersrHrJrJrKr���
zinstall.has_headerscCr�)zMReturns true if the current distribution has any scripts to.
        install.)rm�has_scriptsrHrJrJrKr��r�zinstall.has_scriptscCr�)zJReturns true if the current distribution has any data to.
        install.)rm�has_data_filesrHrJrJrK�has_data�r�zinstall.has_datar8r7r9r:�install_egg_infocCsdS)NTrJrHrJrJrK�<lambda>�szinstall.<lambda>) �__name__�
__module__�__qualname__�descriptionr��boolean_optionsr;r�rr�rLr�rfrgrhr�r�rvrxr{r|r�ryr�r�r�r�r�r�r�r��sub_commandsrJrJrJrKr$rsL>�
T;		",
�r$)+�__doc__rirsrc�re�	distutilsr�distutils.corer�distutils.debugr�distutils.sysconfigrr�distutils.errorsr�distutils.file_utilr�distutils.utilr	r
rrr
�siterrr;r�r�r��distutils_scheme_name�sys_scheme_name�sys_key�_INSTALL_SCHEMES�
sys_scheme�main_keyr��value�sub�replacerqr$rJrJrJrK�<module>s�
�
�

��
�	
�
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY