� !A?hX���� ddlZddlZddlmZddlmZddlmZddlm Z ddl m Z m Z ddlm Z ddlZejd��ZGd �d e��ZGd �d ee ��ZdS) �N)�ST_MODE)� sysconfig)�Command)�newer)� convert_path� Mixin2to3)�logs^#!.*python[0-9.]*([ ].*)?$c�>�eZdZdZgd�ZdgZd�Zd�Zd�Zd�Z d�Z d S) � build_scriptsz("build" scripts (copy and fixup #! line)))z build-dir=�dzdirectory to "build" (copy) to)�force�fz1forcibly build everything (ignore file timestamps)z executable=�ez*specify final destination interpreter pathr c�L�d|_d|_d|_d|_d|_dS�N)� build_dir�scriptsr � executable�outfiles��selfs �L/opt/alt/python-internal/lib64/python3.11/distutils/command/build_scripts.py�initialize_optionsz build_scripts.initialize_optionss)������� ��� ������ � � �c�X�|�dddd��|jj|_dS)N�build)r r)r r )rr)�set_undefined_options� distributionrrs r�finalize_optionszbuild_scripts.finalize_options%s;�� �"�"�7�#A�#5�#?� A� A� A��(�0�� � � rc��|jSr)rrs r�get_source_fileszbuild_scripts.get_source_files,s ���|�rc�@�|jsdS|���dSr)r� copy_scriptsrs r�runzbuild_scripts.run/s)���|� � �F� �������rc �T� |�|j��g}g}|jD�]o}d}t|��}tj�|jtj�|����}|�|��|j s&t||��stj d|���� t|d��}tj|j��\}}|�d��|���} | s|�d|z���� t&�| ��} | rd}| �d��pd} n#t,$r |js�d}YnwxYw|�r�tjd ||j��|�|��|j�s�t2js|j} n[tj�t3jd ��d t3jd ���t3jd ������} t j| ��} d| z| zdz} | �d��n0#t>$r#tAd�!| �����wxYw | �|��n1#t>$r$tAd�!| |�����wxYwt|d��5}|�"| ��|�#|�$����ddd��n #1swxYwY|r|�%����.|r|�%��|�|��|�&||����qtj'dkr~|D]{}|jrtjd|���t j(|��tRdz}|dzdz}||kr,tjd|||��t j*||���|||fS)NFznot copying %s (up-to-date)�rbrz%s is an empty file (skipping)T�rzcopying and adjusting %s -> %s�BINDIR�python�VERSION�EXEs#!� zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})�wb�posixzchanging mode of %si�imz!changing mode of %s from %o to %o)+�mkpathrrr�os�path�join�basename�appendr rr �debug�open�tokenize�detect_encoding�readline�seek�warn� first_line_re�match�group�OSError�dry_run�infor� python_buildr�get_config_var�fsencode�decode�UnicodeDecodeError� ValueError�format�write� writelines� readlines�close� copy_file�name�statr�chmod)rr� updated_files�script�adjust�outfiler�encoding�lines� first_liner=� post_interpr�shebang�outf�file�oldmode�newmodes rr#zbuild_scripts.copy_scripts5s��� � � � �D�N�#�#�#���� ��l�L 0�L 0�F��F�!�&�)�)�F��g�l�l�4�>�2�7�3C�3C�F�3K�3K�L�L�G� �O�O�G� $� $� $��:� �e�F�G�&<�&<� �� �7��@�@�@��  8����&�&�� #+�":�1�:�"F�"F���%����q� � � ��Z�Z�\�\� �!���I�I�>��G�H�H�H��%�+�+�J�7�7���8�!�F�"'�+�+�a�.�.�"7�C�K���� � � ��|������� ����"�, 0���9�6���)�)�)��$�$�W�-�-�-��|�!7�$�1�M�%)�_� � �%'�W�\�\�%�4�X�>�>�>�+4�+C�I�+N�+N�+N�+4�+C�E�+J�+J�+J�L�&M�&M� �"$��Z�!8�!8�J�#�j�0�;�>��F�G� :����w�/�/�/�/��-�:�:�:�(�)�)/�����:�:�:�:����8����x�0�0�0�0��-�8�8�8�(�<�#�V�G�X�6�6�8�8�8�8���� �g�t�,�,�7��� � �7�+�+�+����� � � � �6�6�6�7�7�7�7�7�7�7�7�7�7�7����7�7�7�7����G�G�I�I�I�����G�G�I�I�I��$�$�W�-�-�-����v�w�/�/�/�/� �7�g� � � � 0� 0���<�0��H�2�D�9�9�9�9� �g�d�m�m�G�4�v�=�G�&���&�8�G��'�)�)���!D�!%�w��9�9�9����w�/�/�/����&�&s<�E'�'E>�=E>� I!�!-J�J(�(.K�)=L2�2L6 �9L6 N) �__name__� __module__� __qualname__� description� user_options�boolean_optionsrrr!r$r#�rrr r s�������>�K� � � �L� �i�O����1�1�1������� c'�c'�c'�c'�c'rr c��eZdZd�ZdS)�build_scripts_2to3c�|�t�|��\}}|js|�|��||fSr)r r#r@�run_2to3)rrrQs rr#zbuild_scripts_2to3.copy_scripts�sA��"/�"<�"<�T�"B�"B���-��|� )� �M�M�-� (� (� (���&�&rN)r^r_r`r#rdrrrfrf�s#������'�'�'�'�'rrf)r0�rerOr� distutilsr�distutils.corer�distutils.dep_utilr�distutils.utilrrr r7�compiler<r rfrdrr�ros��5�� � � � � � � �������������"�"�"�"�"�"�$�$�$�$�$�$�2�2�2�2�2�2�2�2������������� �;�<�<� �G'�G'�G'�G'�G'�G�G'�G'�G'�R'�'�'�'�'�� �'�'�'�'�'r