�
ZQd�! � �Z � d Z ddlZddlZddlZddlmZ ddlmZ dZ G d� de� � Z
dS )zkdistutils.command.install_lib
Implements the Distutils 'install_lib' command
(install all Python modules).� N)�Command)�DistutilsOptionErrorz.pyc �f � e Zd ZdZg d�Zg d�ZddiZd� Zd� Zd� Z d � Z
d
� Zd� Zd� Z
d
� Zd� Zd� ZdS )�install_libz7install all Python modules (extensions and pure Python)))zinstall-dir=�dzdirectory to install to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing 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])�
skip-buildNzskip the build steps)r r r r
r c �h � d | _ d | _ d| _ d | _ d | _ d | _ d | _ d S )Nr )�install_dir� build_dirr r �optimize�
skip_build� multiarch��selfs �4/usr/lib/python3.11/distutils/command/install_lib.py�initialize_optionszinstall_lib.initialize_options3 s8 � ���������
������
��������� c
�J � | � dddddddd� � | j �d | _ | j �d
| _ t | j t � � sP t | j � � | _ | j dvrt
�d S # t t
f$ r t d� � �w xY wd S )
N�install)� build_libr )r r )r r )r r )r r )r r )r r TF)r � � zoptimize must be 0, 1, or 2)�set_undefined_optionsr r �
isinstance�int�AssertionError�
ValueErrorr r s r �finalize_optionszinstall_lib.finalize_options= s� � �
�"�"�9�#=�#A�#5�#9�#;�#?�#=� $� $� $� �<���D�L��=� �!�D�M��$�-��-�-� J�
J� #�D�M� 2� 2��
��=� �1�1�(�(� 2�1����/�
J�
J�
J�*�+H�I�I�I�
J���� J� Js �)A? �?!B c � � | � � � | � � � }|�0| j � � � r| � |� � d S d S d S �N)�buildr �distribution�has_pure_modules�byte_compile)r �outfiless r �runzinstall_lib.runX sb � ��
�
����
�<�<�>�>�� ��D�$5�$F�$F�$H�$H�����h�'�'�'�'�'� ���r c �� � | j s^| j � � � r| � d� � | j � � � r| � d� � d S d S d S )N�build_py� build_ext)r r) r* �run_command�has_ext_modulesr s r r( zinstall_lib.buildh s| � ��� .�� �1�1�3�3�
-�� � ��,�,�,�� �0�0�2�2�
.�� � ��-�-�-�-�-� .� .�
.�
.r c � � t j � | j � � r6dd l}| j |j _ | � | j | j � � }n| �
d| j z � � d S |S )Nr z3'%s' does not exist -- no Python modules to install)�os�path�isdirr �distutils.dir_utilr �dir_util�
_multiarch� copy_treer �warn)r � distutilsr, s r r zinstall_lib.installo sz � �
�7�=�=���(�(� �%�%�%�%�,0�N�I��)��~�~�d�n�d�6F�G�G�H�H��I�I�K��n�%�
&�
&�
&��F��r c �2 � t j r| � d� � d S ddlm} | � d� � j }| j r ||d| j || j �� � | j
dk r' ||| j
| j || j | j �� � d S d S )Nz%byte-compiling is disabled, skipping.r )r+ r )r r �prefix�dry_run)r r r> |