add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
�

��VcZBcsF�dZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTgd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zejje_d�Zd�Zd�Zd�Zd�Zd�Zd�Zdadad�Z	ddlm Z d�Z!n#e"$rd�Z!YnwxYwd�Z#dd�d�Z$d �Z%e
j&d!kZ'd$d"�Z(d#�Z)dS)%a�Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
�.�..�/z:z
/bin:/usr/binNz	/dev/null�)Z*)&�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefixZgetsizeZgetmtimeZgetatimeZgetctime�islinkZexists�lexistsZisdirZisfile�ismount�
expanduser�
expandvars�normpath�abspathZsamefileZsameopenfileZsamestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcs4�t|t��rdSdS)N�/r)�
isinstance�bytes��path� �"/usr/lib64/python3.11/posixpath.py�_get_sepr')s���$������t��s�cs*�tj|��S)z6Normalize case of pathname.  Has no effect under Posix��os�fspath)�sr%r&rr4s��
�9�Q�<�<�r(csr�tj|��}t|��}|�|��S)zTest whether a path is absolute)r*r+r'�
startswith)r,r�  r&rr<s,��
�	�!���A�
�1�+�+�C��<�<����r(cs��tj|��}t|��}|}	|s
|dd�|zttj|��D]?}|�|��r|}�|r|�|��r||z
}�7|||zz
}�@n/#tttf$rtj
d|g|�R��wxYw|S)z�Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr)r*r+r'�mapr-�endswith�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)Za�prr$Zb�     r&rrGs���
	�	�!���A�
�1�+�+�C��D���	���!��H�s�N�N��R�Y��"�"�	 �	 �A��|�|�C� � �
 �����
 �T�]�]�3�/�/�
 ���	�����a�����
	 ��
�~�|�4�����$�V�Q�3��3�3�3�3�
������Ks�A)B�,B=cs�tj|��}t|��}|�|��dz}|d|�||d�}}|r+||t	|��zkr|�|��}||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N�r*r+r'�rfind�len�rstrip)r6r�i�head�tailr7r&rrds���	�	�!���A�
�1�+�+�C�	������q��A��2�A�2���!�"�"��$�D�� ���C��I�I�
�%� ��{�{�3������:�r(cs��tj|��}t|t��rd}d}nd}d}t	j||d|��S)Nr �.rr)r*r+r!r"r4�	_splitext)r6rr�   r&r	r	usN��
�	�!���A��!�U�������������� ��C��v�6�6�6r(csB�tj|��}|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr))r6r%r&rr�s"��	�	�!���A��R�a�R�5�!�8�Or(cs��tj|��}t|��}|�|��dz}||d�S)z)Returns the final component of a pathnamer8N)r*r+r'r:)r6rr=rBr&r
r
�s;��
�	�!���A�
�1�+�+�C�	������q��A��Q�R�R�5�Lr(cs��tj|��}t|��}|�|��dz}|d|�}|r+||t	|��zkr|�|��}|S)z-Returns the directory component of a pathnamer8Nr9)r6rr=r>�    r&rr�so��
�	�!���A�
�1�+�+�C�	������q��A��R�a�R�5�D�� ���C��I�I�
�%� ��{�{�3�����Kr(cs��	tj|��}n#tttf$rYdSwxYwtj|j��S)z&Test whether a path is a symbolic linkF)r*�lstat�OSError�
ValueErrorr2�stat�S_ISLNK�st_mode)r$�str.r&r
r
�sQ���
�X�d�^�^�����Z��0�����u�u������<��
�#�#�#s��2�2csb�	tj|��n#ttf$rYdSwxYwdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r*rDrErFr#r%r&rr�sB���
���������Z� �����u�u������4s��,�,cs��	tj|��}tj|j��rdSn#t
tf$rYdSwxYwt|t��rt|d��}nt|d��}t|��}	tj|��}n#t
tf$rYdSwxYw|j}|j}||krdS|j}|j}||krdSdS)z$Test whether a path is a mount pointF�..rT)
r*rDrGrHrIrErFr!r"rrZst_devZst_ino)r$�s1Zparent�s2Zdev1Zdev2Zino1Zino2s        r&rr�s ���
�X�d�^�^���<��
�#�#�	��5�	��
�Z� �����u�u������$����"��d�E�"�"����d�D�!�!��
�f�
�
�F��
�X�f�
�
�����Z� �����u�u������9�D�
�9�D��t�|���t�
�9�D�
�9�D��t�|���t��5s!�2�A�A�B%�%B:�9B:cs��tj|��}t|t��rd}nd}|�|��s|St|��}|�|d��}|dkrt|��}|dkrxdtjvrW	ddl	}n#t$r|cYSwxYw	|�tj����j
}n�#t$r|cYSwxYwtjd}nw	ddl	}n#t$r|cYSwxYw|d|�}t|t��rt|d��}	|�|��}n#t$r|cYSwxYw|j
}|�t"jdkr|St|t��rtj|��}d	}nd
}|�|��}|||d�zp|S)zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.s~z~r8rZHOMEN�ASCIIZvxworksr r)r*r+r!r"r-r'Zfindr;�environ�pwd�ImportErrorZgetpwuidZgetuidZpw_dir�KeyErrorZstrZgetpwnam�sys�platform�fsencoder<)	r$Ztilderr=rPZuserhome�nameZpwentZroot�	         r&rr�s?���9�T�?�?�D��$�����������?�?�5�!�!����
�4�.�.�C��	�	�#�q���A��1�u����I�I���A�v� ����#�
	*�
��
�
�
�
���
�
�
�����
����
��<�<��	���4�4�;�����
�
�
�����
����
�z�&�)�H�H�	��J�J�J�J���	�	�	��K�K�K�	�����A�a�C�y���d�E�"�"�	&��t�W�%�%�D�	��L�L��&�&�E�E���	�	�	��K�K�K�	�����<����C�L�I�5�����$������;�x�(�(����������t�$�$�H��t�A�B�B�x��(�D�(sH�B�B)�(B)�-+C�C(�'C(�?D�D�D�E�E+�*E+csv�tj|��}t|t��rSd|vr|Stsddl}|�d|j��atj}d}d}ttdd��}nHd|vr|Stsddl}|�d	|j��a
tj}d
}d}tj}d}	|||��}|sn�|�d��\}}|�
d
��}	|	�|��r|	�|��r
|	d
d�}		|�7tjtjtj|	����}
n||	}
||d�}|d|�|
z}t%|��}||z
}n#t&$r|}YnwxYw��|S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.s$rNs\$(\w+|\{[^}]*\})s{s}Zenvironbz$z\$(\w+|\{[^}]*\})z{z}Tr8�����)r*r+r!r"�	_varprogb�reZcompilerN�searchZgetattr�_varprogrOZspanZgroupr-r0rU�fsdecoder;rR)r$rZr[�startZendrOr=ZmZjrVZvaluer?s            r&rr$s����9�T�?�?�D��$������t��	��K��	D��I�I�I��
�
�#8�"�(�C�C�I��!�������"�j�$�/�/����d�?�	��K��	B��I�I�I��z�z�"6���A�A�H���������*��	�A���F�4��O�O���	���v�v�a�y�y���1��w�w�q�z�z���?�?�5�!�!�	�d�m�m�C�&8�&8�	���"��:�D�	��
&���B�J�r�{�4�/@�/@�$A�B�B�����
������8�D�����8�e�#�D��D�	�	�A��D�L�D�D��
�	�	�	��A�A�A�	�����(�Ks�9AF&�&F5�4F5)�_path_normpathcs��tj|��}t|t��r5tjttj|������pdSt|��pdS)�0Normalize path, eliminating double slashes, etc.r@r)r*r+r!r"rUr_r]r#r%r&rr�s\���y������d�E�"�"�	J��;�~�b�k�$�.?�.?�@�@�A�A�I�T�I��d�#�#�*�s�*r(cs0�tj|��}t|t��r	d}d}d}d}nd}d}d}d}||kr|S|�|��}|r2|�|d	z��r|�|d
z��sd	}|�|��}g}|D]M}|||fvr�	||ks|s|r|r"|d|kr|�|���7|r|����N|}|�|��}|r||z|z}|p|S)r`r r(r@rKrZrriirX)	r*r+r!r"r-rZappendZpopr)	r$rZemptyZdotZdotdotZinitial_slashesZcompsZ	new_compsZcomprWr&rr]sx���y������d�E�"�"�		��C��E��C��F�F��C��E��C��F��5�=�	��J��/�/�#�.�.��
�	 ��O�O�C��E�"�"�	 �+/�?�?�3�q�5�+A�+A�	 ��O��
�
�3�����	��	 �	 �D���s�|�#�
�����
 ��
 �y�
 ��
 � )�"�
�� 7�
 �� � ��&�&�&�&��
 ��
�
��������x�x������	.���&��-�D��{�s�r(cs��tj|��}t|��sLt|t��rtj��}ntj��}t||��}t|��S)zReturn an absolute path.)	r*r+rr!r"ZgetcwdbZgetcwdrr)r$Zcwdr.r&rr�s`��
�9�T�?�?�D���;�;���d�E�"�"�	��*�,�,�C�C��)�+�+�C��C������D�>�>�r(F)�strictcs��tj|��}t|dd�||i��\}}t|��S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r*r+�
_joinrealpathr)Zfilenamerar$�okrCr&rr�s>���y��"�"�H��X�b�q�b�\�8�V�R�@�@�H�D�"��4�=�=�r(cs��t|t��rd}d}d}nd}d}d}t|��r|dd�}|}|�r0|�|��\}}}|r||kr�%||kr/|r*t	|��\}}||krt|||��}n|}�Zt||��}		t
j|	��}
tj	|
j
��}n#t$r|r�d}YnwxYw|s|	}��|	|vr4||	}|���|rt
j|	��nt|	|��dfSd||	<t|t
j
|	��||��\}}|st||��dfS|||	<|��0|d	fS)
Nr r@rKrrrr8FT)r!r"rZ	partitionrrr*rDrGrHrIrErbZreadlink)
r$ZrestraZseenrrrrVZ_ZnewpathrJZis_linkrcs
             r&rbrb�s���$�������������������T�{�{���A�B�B�x����
�,����s�+�+�
��a���	�t�v�~�	���6�>�	��
�"�4�[�[�
��d��6�>�6���f�f�5�5�D������t�T�"�"��	/���'�"�"�B��l�2�:�.�.�G�G���	�	�	��
���G�G�G�	�����	��D���d�?�	2���=�D��
���
2���� � � � ��G�T�*�*�E�1�1���W�
� ��r�{�7�';�';�V�T�J�J���b��	+���d�#�#�U�*�*���W�
�Y�,�\��:�s�)C�C)�(C)Zdarwincs|�|std���tj|��}t|t��rd}d}d}nd}d}d}|�|}ntj|��}	d	�t|���|��D��}d
�t|���|��D��}tt||g����}|gt|��|z
z||d�z}|s|St|�S#ttttf$rtjd||���wxYw)z#Return a relative version of a pathzno path specifiedr@r rKrrrNc��g|]}|�|��S�re��.0Zxr.r&�
<listcomp>�relpath.<locals>.<listcomp>�s��@�@�@�A�a�@�a�@�@�@r(crdrererfr.r&rhri�s��>�>�>�1�A�>�Q�>�>�>r(r)rFr*r+r!r"rrr;rrr1r2r3ZDeprecationWarningr4r5)	r$r^rrrZ
start_listZ	path_listr=Zrel_listrWr&rr�s]���.��,�-�-�-�
�9�T�?�?�D��$�������������������!�����	�%� � ���@�@�����!5�!5�c�!:�!:�@�@�@�
�>�>���
�
� 3� 3�C� 8� 8�>�>�>�	���j�)�4�5�5�6�6���8�s�:���q�0�1�I�a�b�b�M�A���	��M��X�����~�|�5G�H�����$�Y��e�<�<�<�
����s�"BD�=D�5D;cs��	�
�|std���tttj|����}t|dt��rd�
d�	nd�
d�		�
fd�|D��}	t�
fd�|D����\}n#t$rtd	��d
�wxYw�	fd�|D��}t|��}t|��}|}t|��D]\}}|||kr|d
|�}n�|r�
n	�
d
d�}|�
�|��zS#ttf$rtjdg|�R��wxYw)
zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr r@rrcs:��g|]}|������Sre)r)rgr$r�  �r&rh�commonpath.<locals>.<listcomp>s#���9�9�9�4�t�z�z�#���9�9�9r(c3s4�K�|]}|dd��kV��dS)Nr8re)rgr6rrjr&z	<genexpr>zcommonpath.<locals>.<genexpr> s/�����5�5�!��2�A�2��#��5�5�5�5�5�5r(z%Can't mix absolute and relative pathsNcs,��g|]}�fd�|D����S)cs$��g|]}|�|�k�
|��
Srere)rg�crrjr&rhz)commonpath.<locals>.<listcomp>.<listcomp>$s'���:�:�:�a��:�a�6�k�:��:�:�:r(re)rgr,rrjr&rhrk$s.���P�P�P�q�:�:�:�:�1�:�:�:�P�P�Pr(r)rFZtupler/r*r+r!r"ZsetZminZmaxZ	enumeraterr1r2r4r5)ZpathsZsplit_pathsrrLrMZcommonr=rlZprefixrrs         @@r&rrs������B��@�A�A�A��#�b�i��'�'�(�(�E��%��(�E�"�"������������9�9�9�9�5�9�9�9��	P��5�5�5�5�u�5�5�5�5�5�F�E�E���	P�	P�	P��D�E�E�4�O�	P����Q�P�P�P�K�P�P�P��
��
�
��
��
�
�����b�M�M�	�	�D�A�q��B�q�E�z�
��B�Q�B�����
��*���3�r��r�7�������(�(�(�(���~�&�����$�\�:�E�:�:�:�:�
����s%� D,�/B
�D,�
B(�(BD,�,%E)N)*Z__doc__rrrrrrrrr*rSrGr4Z__all__r'rrrrr	rArr
rr
rrrr\rYrZposixr_rrQrrrbrTrrrrer(r&�<module>rmsL��
�
�

��	
��	��	��

��
��	
��
��	�	�	�	�
�
�
�
�����������������������������:	�	�	�"7�7�7��(�0���
���������$�$�$�������T6)�6)�6)�z���	�.�.�.�j0+�$�$�$�$�$�$�T+�+�+�+��Q�%�%�%�$�$�$�$�$�%����`	�	�	�"'������<�<�<�~"�l�h�6��!�!�!�!�R#�#�#�#�#s�+A5�5B�?B