� !A?h� ��Z�dZddlZddlZddlZddlmZddlmZdZ Gd�de��Z dS)zkdistutils.command.install_lib Implements the Distutils 'install_lib' command (install all Python modules).�N)�Command)�DistutilsOptionErrorz.pyc�f�eZdZdZgd�Zgd�ZddiZd�Zd�Zd�Z d �Z d �Z d �Z d �Z d �Zd�Zd�ZdS)� install_libz7install all Python modules (extensions and pure Python)))z install-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 rr r c�Z�d|_d|_d|_d|_d|_d|_dS)Nr)� install_dir� build_dirr r �optimize� skip_build��selfs �J/opt/alt/python-internal/lib64/python3.11/distutils/command/install_lib.py�initialize_optionszinstall_lib.initialize_options3s1���������� ��� ��� ������c �H�|�ddddddd��|j�d|_|j�d |_t|jt��sP t |j��|_|jd vrt �dS#t t f$rtd ���wxYwdS) N�install)� build_libr)rr)r r )r r )rr)rrTF)r��zoptimize must be 0, 1, or 2)�set_undefined_optionsr r� isinstance�int�AssertionError� ValueErrorrrs 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>�>!Bc��|���|���}|�0|j���r|�|��dSdSdS�N)�buildr� distribution�has_pure_modules� byte_compile�r�outfiless r�runzinstall_lib.runVsb�� � � � � � � �<�<�>�>�� � �D�$5�$F�$F�$H�$H� � � � �h� '� '� '� '� '� � � � rc���|js^|j���r|�d��|j���r|�d��dSdSdS)N�build_py� build_ext)rr(r)� run_command�has_ext_modulesrs rr'zinstall_lib.buildfs|���� .�� �1�1�3�3� -�� � ��,�,�,�� �0�0�2�2� .�� � ��-�-�-�-�-�  .� .� .� .rc���tj�|j��r!|�|j|j��}n|�d|jz��dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�path�isdirr� copy_treer�warnr+s rrzinstall_lib.installmsa�� �7�=�=��� (� (� ��~�~�d�n�d�6F�G�G�H�H� �I�I�K��n�%� &� &� &� �F��rc�2�tjr|�d��dSddlm}|�d��j}|jr||d|j||j ���|j dkr'|||j |j||j |j ���dSdS)Nz%byte-compiling is disabled, skipping.r)r*r)rr �prefix�dry_run)rr r:�verboser;) �sys�dont_write_bytecoder8�distutils.utilr*�get_finalized_command�rootr r r;rr<)r�filesr*� install_roots rr*zinstall_lib.byte_compilevs��� � "� � �I�I�=� >� >� >� �F�/�/�/�/�/�/� �1�1�)�<�<�A� � �<� /� �L���#�z�,�!%�� /� /� /� /� �=�1� � � �L����#�z�,�!%��t�|� E� E� E� E� E� E� � rc �V�|sgS|�|��}|���}t||��}t|��ttj��z}g}|D]=} |�tj�|| |d������>|Sr&) r@� get_outputs�getattr�lenr4�sep�appendr5�join) r�has_any� build_cmd� cmd_option� output_dir� build_filesr� prefix_len�outputs�files r�_mutate_outputszinstall_lib._mutate_outputs�s���� ��I��.�.�y�9�9� ��+�+�-�-� ��I�z�2�2� ���^�^�c�"�&�k�k�1� ���� H� H�D� �N�N�2�7�<�<� �D����4E�F�F� G� G� G� G��rc��g}|D]�}tj�tj�|����d}|tkr�P|jr4|�tj� |d�����|j dkr9|�tj� ||j �������|S)Nr�)� optimizationr) r4r5�splitext�normcase�PYTHON_SOURCE_EXTENSIONr rI� importlib�util�cache_from_sourcer)r� py_filenames�bytecode_files�py_file�exts r�_bytecode_filenameszinstall_lib._bytecode_filenames�s�����#� :� :�G��'�"�"�2�7�#3�#3�G�#<�#<�=�=�a�@�C��-�-�-���|� /��%�%�i�n�&F�&F��"�'G�'.�'.�/�/�/��}�q� � ��%�%�i�n�&F�&F��$�-�'G�'9�'9�:�:�:���rc� �|�|j���dd|j��}|jr|�|��}ng}|�|j���dd|j��}||z|zS)z�Return the list of files that would be installed if this command were actually run. Not affected by the "dry-run" flag or whether modules have actually been built yet. r/rr0)rSr(r)rr rar2)r� pure_outputs�bytecode_outputs� ext_outputss rrEzinstall_lib.get_outputs�s��� � � ��!2�!C�!C�!E�!E�!+�[�!%�!1� 3� 3� � �<� "�#�7�7� �E�E� � �!� � � � ��!2�!B�!B�!D�!D�!,�k�!%�!1� 3� 3� � �.�.��<�rvs���!�!�  � � � ����� � � � �"�"�"�"�"�"�1�1�1�1�1�1� ��H�H�H�H�H�'�H�H�H�H�Hr