add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
�

�Wc�F��j�	ddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZGd�d�ZdS)�N)�DistutilsOptionError)�util�dir_util�	file_util�archive_util�dep_util��logc���eZdZ	gZd�Zd�Zd�Zd�Zd�Zd$d�Z	d	�Z
d%d�Zd�Zd&d
�Z
d&d�Zd�Z	d&d�Zd�Zd�Zd�Zd�Zd%d�Zd'd�Zd�Zd�Zd�Zd(d�Zd)d�Z		d*d�Z		d+d�Zd%d �Zd,d!�Z		d-d"�Z 	d.d#�Z!dS)/�Commandc��	ddlm}t||�s
td��|jt
ur
t
d��||_|j�d|_	|j|_
d|_d|_d|_
dS)Nr)�Distributionz$dist must be a Distribution instancezCommand is an abstract class)�distutils.distr�
isinstance�	TypeError�	__class__r�RuntimeError�distribution�initialize_options�_dry_run�verbose�force�help�	finalized)�self�distrs   �&/usr/lib64/python3.12/distutils/cmd.py�__init__zCommand.__init__/s���	�	0�/�/�/�/�/��$��-�-��B�C�C��>�>�W�$�$��=�>�>� ������!�!���
��|�|�����
���	������c��|dkr-t|d|z�}|�t|j|�S|St|��)N�dry_run�_)�getattrr�AttributeError)r�attr�myvals   r�__getattr__zCommand.__getattr___sE���9����D�#��*�-�E��}��t�0�0�$�7�7��� ��&�&rc�N�|js|j�d|_dS�N�)r�finalize_options�rs r�ensure_finalizedzCommand.ensure_finalizedis%���~�~�~��!�!�#�#�����rc�8�	td|jz���Nz,abstract method -- subclass %s must override�rrr,s rrzCommand.initialize_options{�%��	��I�!�^�^�,�-�	-rc�8�	td|jz��r/r0r,s rr+zCommand.finalize_options�s%��		��I�!�^�^�,�-�	-rN�c�t�ddlm}|�d|j�z}|j||ztj
��|dz}|jD]b\}}}|j|�}|ddkr|dd}t||�}|j||�d|��ztj
���ddS)	Nr)�
longopt_xlatezcommand options for '%s':)�levelz  ������=z = )	�distutils.fancy_getoptr5�get_command_name�announcer
�INFO�user_options�	translater#)r�header�indentr5�optionr"�values       r�dump_optionszCommand.dump_options�s���8�8�8�8�8�8��>�0�4�3H�3H�3J�J�F��
�
�f�v�o�S�X�X�
�6�6��$���"�/�/�	*�	*�N�V�Q���%�%�m�4�F��b�z�S� � �������D�&�)�E��M�M�&������#>�>� #���
�
*�
*�
*�	*�	*rc�8�	td|jz��r/r0r,s r�runzCommand.run�r1rr*c�8�	tj||�dS�Nr	)r�msgr6s   rr;zCommand.announce�s ��	�	����s����rc�v�	ddlm}|r/t|�tjj�dSdS)Nr)�DEBUG)�distutils.debugrJ�print�sys�stdout�flush)rrHrJs   r�debug_printzCommand.debug_print�sI��	�	*�)�)�)�)�)��5��#�J�J��J�J��������5rc	��t||�}|�t|||�|St|t�st	d|�d|�d|�d���|S)N�'z' must be a z (got `z`))r#�setattrr�strr)rrA�what�default�vals     r�_ensure_stringlikezCommand._ensure_stringlike�sa���d�F�#���;��D�&�'�*�*��N��C��%�%�&�&�*0�&�&�$�$�$����(=�>�
>��
rc�0�	|j|d|�dS)N�string)rX)rrArVs   r�
ensure_stringzCommand.ensure_string�s$��	�	
�����'�:�:�:�:rc�"�	t||�}|�dSt|t�r't||t	j
d|��dSt|t�rtd�|D��}nd}|std|�d|�d���dS)Nz,\s*|\s+c3�>K�|]}t|t����dSrG)rrT)�.0�vs  r�	<genexpr>z-Command.ensure_string_list.<locals>.<genexpr>�s)����9�9���A�s�+�+�+�+�+�9�9rFrRz!' must be a list of strings (got �))	r#rrTrS�re�split�list�allr)rrArW�oks    r�ensure_string_listzCommand.ensure_string_list�s���	�
�d�F�#���;��F�
��S�
!�
!��D�&�"�(�(�;��"<�=�=�=�=��#�t�$�$��9�9�S�9�9�9������2�*�*�������&�'�'��2rc�r�|j|||�}|� ||�std|z||fz��dSdS)Nzerror in '%s' option: )rXr)rrA�testerrU�	error_fmtrVrWs       r�_ensure_tested_stringzCommand._ensure_tested_string�sQ���%�%�f�d�G�<���?�6�6�#�;�;�&�(@�9�(L�*0�#��(7�8�
8�$/�;�?�?rc�d�	|j|tjjdd�dS)N�filenamez$'%s' does not exist or is not a file)rk�os�path�isfile�rrAs  r�ensure_filenamezCommand.ensure_filename�s8��C��"�"�6�2�7�7�>�>�#-�#I�	K�	K�	K�	Krc�b�|j|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rkrnro�isdirrqs  r�ensure_dirnamezCommand.ensure_dirnames5���"�"�6�2�7�7�=�=�#3�#N�	P�	P�	P�	Prc�b�t|d�r|jS|jjS)N�command_name)�hasattrrwr�__name__r,s rr:zCommand.get_command_name	s+���4��(�(��$�$�$��>�>�*�*�*rc	���	|jj|�}|j�|D]/\}}t||���t	||t||���1dSrG)r�get_command_objr-r#rS)r�src_cmd�option_pairs�src_cmd_obj�
src_option�
dst_options      r�set_undefined_optionszCommand.set_undefined_optionssw��	��'�'�7�7��@���$�$�&�&�(4�	L�	L�$�Z���t�Z�(�0����j�'�+�z�*J�K�K�K�	L�	Lrc�d�	|jj||�}|j�|SrG)rr{r-)r�command�create�cmd_objs    r�get_finalized_commandzCommand.get_finalized_command$s5��	�
�#�#�3�3�G�V�D��� � �"�"��rrc�<�|jj||�SrG)r�reinitialize_command)rr��reinit_subcommandss   rr�zCommand.reinitialize_command0s"��� � �5�5�g�6H�J�	Jrc�@�	|jj|�dSrG)r�run_command)rr�s  rr�zCommand.run_command4s&��	�	
���%�%�g�.�.�.�.rc�n�	g}|jD]#\}}|�
||�s�|j|��%|SrG)�sub_commands�append)r�commands�cmd_name�methods    r�get_sub_commandszCommand.get_sub_commands;sO��	���"&�"3�"3�	*�	*��X�v��~�����������)�)�)��rc�V�tjd|j�|�dS)Nzwarning: %s: %s
)r
�warnr:)rrHs  rr�zCommand.warnKs%�����$�d�&;�&;�&=�s�C�C�C�Crc�P�tj||||j��dS�N�r!)r�executer!)r�func�argsrHr6s     rr�zCommand.executeNs$�����T�4��d�l�l�;�;�;�;�;r��c�N�tj|||j��dSr�)r�mkpathr!)r�name�modes   rr�zCommand.mkpathQs"������d�D�L�L�9�9�9�9�9rc	�j�	tj|||||j||j��Sr�)r�	copy_filerr!)r�infile�outfile�
preserve_mode�preserve_times�linkr6s       rr�zCommand.copy_fileTs<��	L��"�"�6�7�M�#1�t�z�z�>�4�+/�<�<�9�9�	9rc	�j�	tj||||||j|j��Sr�)r�	copy_treerr!)rr�r�r�r��preserve_symlinksr6s       rr�zCommand.copy_tree]s?��	��!�!�&�'�=�"0�2C�&*�j�j�.�$�,�,�H�H�	Hrc�L�	tj|||j��Sr�)r�	move_filer!)r�src�dstr6s    rr�zCommand.move_filefs!��2��"�"�3��T�\�\�B�B�Brc�@�	ddlm}||||j��dS)Nr)�spawnr�)�distutils.spawnr�r!)r�cmd�search_pathr6r�s     rr�z
Command.spawnjs5��@�)�)�)�)�)�)�
��c�;����5�5�5�5�5rc	�R�tj|||||j||��S)N)r!�owner�group)r�make_archiver!)r�	base_name�format�root_dir�base_dirr�r�s       rr�zCommand.make_archiveos1���(�(��F�H�h�15���/4�E�C�C�	Crc�j�	|�d|z}t|t�r|f}n't|ttf�s
t	d��|�d|�ddj|���}|jstj||�r|j||||�dStj|�dS)Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating z from z, )rrTrd�tupler�joinrr�newer_groupr�r
�debug)r�infilesr�r�r��exec_msg�skip_msgr6s        r�	make_filezCommand.make_fileus���	���7�'�A�H��g�s�#�#��j�G�G��G�d�E�]�3�3��M�O�
O����29�'�'�4�9�9�W�;M�;M�N�H�
�:�:�:��-�-�g�w�?�?��L�L��t�X�u�5�5�5�5�
�I�I�h����r)Nr3)r*rG)rr))r�)r*r*Nr*)r*r*rr*)r*r*)NNNN)NNr*)"ry�
__module__�__qualname__r�rr'r-rr+rCrEr;rPrXr[rgrkrrrur:r�r�r�r�r�r�r�r�r�r�r�r�r�r��rrrrsr������
�:�L�
-�-�-�`'�'�'����$-�-�-�-�-�-�*�*�*�*�-�-�-��������.����;�;�;�;�'�'�'�,'+�8�8�8�8�K�K�K�P�P�P�+�+�+�L�L�L�*����J�J�J�J�/�/�/���� D�D�D�<�<�<�<�:�:�:�:�JK�#$�9�9�9�9�JK�./�H�H�H�H�C�C�C�C�6�6�6�6�
GK�'+�C�C�C�C�78� � � � � � rr)
rMrnrb�distutils.errorsr�	distutilsrrrrrr
rr�rr�<module>r�s����������������1�1�1�1�1�1�G�G�G�G�G�G�G�G�G�G�G�G�G�G�������G �G �G �G �G �G �G �G �G r