add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
�

Jz`f�Pcs�SSKrSSKrSSKrSSKrSSKrSSKrSSKJr SSK	J
r
 /SQrS
SjrSSSSSS.Sjjr
SSSSSS.S	jjrSS
jrSr\S:Xa%\"\"5(+5r\R("\5 gg)�N)�partial)�Path)�compile_dir�compile_file�compile_pathc#sZ# �US:a5[U[R5(a[R"U5nU(d[	SRU55 [R"U5nUR5 UH�nUS:XaM[RRX5n[RRU5(dUv� MTUS:�dM\U[R:wdMrU[R:wdM�[RRU5(dM�[RRU5(aM�[XQS-
US9Shv�N M� g![a& US:a[	SRU55 /nGN/f=fN<7f)N�zListing {!r}...zCan't list {!r}Z__pycache__r�)�	maxlevels�quiet)�
isinstance�osZPathLike�fspath�print�formatZlistdir�OSErrorZsort�path�joinZisdir�curdirZpardir�islink�	_walk_dir)�dirrr	Znames�name�fullnames      �#/usr/lib64/python3.13/compileall.pyrrs4����q�y�Z��R�[�[�1�1��i�i��n���
��&�&�s�+�,���
�
�3���

�J�J�L��	.���=� ���7�7�<�<��*���w�w�}�}�X�&�&��N��!�m���	�	� 1�d�b�i�i�6G��g�g�m�m�H�%�%�b�g�g�n�n�X�.F�.F� ���]�',�.�
.�
.�	.�����1�9��#�*�*�3�/�0�����
.�sU�AF+� E6�6A*F+�$F+�:F+�"F+�6"F+�F+�,F)�-	F+�6,F&�"F+�%F&�&F+F��stripdir�
prependdir�
limit_sl_dest�hardlink_dupesc
sp�SnUbU
cUb[S5eUbUn
UnSnUS:a[S5eUS:waSSKJn U"5 SSKJn Uc[R"5n[XUS9nSnUS:wa{UbxSSK	nUR5S	:XaURS
5nOSnU=(d SnU"UUS9nUR[[X#XEUUU	U
UUU
S9US
S9n[USS9nSSS5 U$UHn[UX#XEXgU	X�UU
S9(aMSnM U$![
a SnN�f=f!,(df   U$=f)N�PDestination dir (ddir) cannot be used in combination with stripdir or prependdirrz%workers must be greater or equal to 0r)�_check_system_limits)�ProcessPoolExecutor)r	rTZforkZ
forkserver)Zmax_workers�
mp_context)�ddir�force�rxr	�legacy�optimize�invalidation_moderrrri)Z	chunksize)�defaultrF)�
ValueErrorZconcurrent.futures.processrZconcurrent.futuresr ZNotImplementedError�sysZgetrecursionlimitr�multiprocessingZget_start_methodZget_contextZmaprrZmin)rrr"r#r$r	r%r&�workersr'rrrrr rZfiles�successr+r!ZexecutorZresultsZfiles                       rrr0s���8����X�1�Z�5K��G�I�	I������
�����{��@�A�A��!�|�C�	?� �"�
?����)�)�+�	��c�)�<�E��G��!�|�+�7���+�+�-��7�(�4�4�\�B�J��J��/�T��
 �W�,6�8�	1�;C��l�l�7�<�04�.0�28�4<�=N�4<�6@�9F�:H�	$J�$)�-.�#�0�G��'�4�0�G�	1�.�N��	 �D���d�2� &�2C�)1�.;�/=�	?�?�
 ��
	 ��N��O#�	��G�	�� 	1�	1�.�N�s�D�60D&�D#�"D#�&
D5c
s��UbUcU	b[S5eSn[R"U5nUb[R"U5OSn[RR	U5n
SnUb[RRX5nUb�UR
[RR5nUR
[RR5nUUS[U5:wa!US:a[SRX�55 O)[RR
"U[U5S6nU	bBUc [RRX�5nO[RRX�5n[U[5(aU/n[[U55nU(a[U5S:a[S5eUbURU5nU(aU$U
bd[RR!U5(a@[#U
5R%5[#U5R%5R&;aU$0n[RR)U5(Ga�UHmnU(a
US-UU'MUS:�a/US:�aUOS	n[*R,R/UUS
9nUUU'MI[*R,R/U5nUUU'Mo U
SSU
SSnnUS:XGaqU(d�[[R0"U5R25n[4R6"S
[*R,R8SUS-5nUR;5H1n[=US5nUR?S5nSSS5 UW:wdM1 O U$U(d[SRU55 [CU5H�unnUUn[DRF"UUUSUUS9nUS:�dM,U(dM5UUUS-
n[HRJ"UUSS9(dM][RL"U5 [RN"UU5 M� WS:XaSnU$U$!,(df   N�=f![@a N�f=f![DRPa�nSnUS:�aUsSnA$U(a[SRU55 O
[SS	S9 [RRTRV=(d [RRX"5n URZR]U SS9R_U 5n![U!5 SnAU$SnAf[`[b[@4ain"SnUS:�aUsSn"A"$U(a[SRU55 O
[SS	S9 [U"RdRfS-U"5 Sn"A"U$Sn"A"ff=f)NrTrzKThe stripdir path {!r} is not a valid prefix for source path {!r}; ignoringzXHardlinking of duplicated bytecode makes sense only for more than one optimization levelZcrr�)Zoptimizationi����z.pyz<4sLLl��ZrbizCompiling {!r}...)r&r'F)Zshallowz*** Error compiling {!r}...z*** )ZendZbackslashreplace)ZerrorsZ:)4r)rrrZbasenamerZsplitZsep�lenr
rr
�int�sortedZsetZsearchrrZresolveZparents�isfile�	importlibZutilZcache_from_sourceZstatZst_mtime�structZpackZMAGIC_NUMBERZvalues�openZreadrZ	enumerate�
py_compile�compile�filecmpZcmpZunlinkZlinkZPyCompileErrorr*Zstdout�encodingZgetdefaultencoding�msgZencodeZdecodeZSyntaxErrorZUnicodeErrorZ	__class__�__name__)#rr"r#r$r	r%r&r'rrrrr-rZdfileZfullname_partsZstripdir_partsZmoZ
opt_cfilesZ	opt_levelZoptZcfileZheadZtailZmtimeZexpectZchandleZactualZindexZokZprevious_cfileZerrr9r:Zes#                                   rrr�s��6��X�1�Z�5K��G�I�	I��G��y�y��"�H�&.�&:�r�y�y��"��H�
�7�7���H�%�D��E��������T�(����!��������4��!��������4���^�,@�S��-@�A�A��q�y��3�39�6�(�3M�O���G�G�L�L�.��^�1D�1E�"F�G�E����=��G�G�L�L��6�E��G�G�L�L��3�E��(�C� � ��:���c�(�m�$�H��#�h�-�!�+��F�G�	G�
�~�
�Y�Y�x�
 ��
��N�� �R�W�W�^�^�H�%=�%=��
��&�&�(��X��0F�0F�0H�0P�0P�P��N��J�	�w�w�~�~�h���!�	2�I��(0�3��
�9�%���>�'0�A�~�)�2�C�&�^�^�=�=�%�C�>�9�E�,1�J�y�)�%�N�N�<�<�X�F�E�,1�J�y�)�	2��#�2�Y��R�S�	�d���5�=�������� 1� :� :�;�E�#�[�[��)�.�.�2M�2M�)*�E�K�,?�A�F�!+�!2�!2�!4�'��!�%��.�6�'�%,�\�\�"�%5�F�6�!�V�+�!�	'� '����)�0�0��:�;�"
$�(1�(�(;�	;�$�E�9�&�y�1�E�#�+�+�H�e�U�D�5>�>O�Q�B��q�y�^�^�)3�H�U�Q�Y�4G�)H��"�;�;�u�n�e�L�L��I�I�e�,��G�G�N�E�:�	;�@��7�#�G��N�7�N�[6�6��������,�,�
����A�:�"�N���7�>�>�x�H�I��&�b�)��:�:�.�.�J�#�2H�2H�2J���g�g�n�n�X�6H�n�I�P�P�QY�Z���c�
�
��N�� ��w�7�
5����A�:�"�N���7�>�>�x�H�I��&�b�)��a�k�k�*�*�S�0�!�4�4��N��
5�s��A<R�Q0�R�#R�%R�3R�R�$R�31R�0
Q>	�:R�
R�
R�W�%	U�.W�4BU�W�(	W�1W�7AW�Wcs��Sn[RHSnU(aU[R:XaU(aUS:a
[	S5 M8M:U=(a [UUSUUUUUS9nMU U$)NTrzSkipping current directory)r	r%r&r')r*rrrr
r)	Zskip_curdirrr#r	r%r&r'r-rs	         rrrss���G��x�x����s�b�i�i�'�[��q�y��2�3���	�+�������!�"3�	#�G���N�cs�
�SSKnURSS9nURSSSSSSS9 URS	[S
SS9 URS
SSSS9 URSSSSSS9 URSSSSS9 URSSSSSS9 URSS S!SS"S9 URS#S$S%SS&S9 URS'S(S)SS*S9 URS+S,S-S.S/9 URS0S1S2S3S49 URS5S6S7[S8S99 [R
Vs/sH-nURR5RS:S;5PM/ nnURS<[U5S=S>9 URS?S@[SASBSC9 URSDSESFSGS/9 URSHSSISJS9 UR5nURnUR(a$SSK
nURUR5UlURSK:XaSUlUR b
UR nOUR"nUR$cSL/Ul['UR$5S7:Xa"UR((aUR+SM5 UR,b+UR.c
UR0bUR+SN5 UR2(afUR2S;:Xa[4R6O[9UR2SOSP9nUH"n	UR;U	R=55 M$ SSS5 URF(a>URFRS;S:5RI5n
[R
U
nOSnSTnU(Ga@UGH7n
[JRLROU
5(a�[QX�R,URRURUR@URTUUR.UR0UR$URUR(SU9(dSSnM�M�[WX�UR,URRURUR@URTURXUUR.UR0UR$URUR(SV9(aGM5SSnGM: U$[[URTURRUR@USW9$s snf!,(df   GN�=f![>a7 UR@SQ:a$[CSRREUR255 gSf=f![\a UR@SQ:a[CSX5 gSf=f)YNrz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrz!don't recurse into subdirectories)�actionZconstr(�dest�helpz-r�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)�typer>r?z-fZ
store_truer#z/force rebuild even if timestamps are up to date)r=r>r?z-qZcountr	zIoutput only error messages; -qq will suppress the error messages as well.)r=r>r(r?z-br%z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr"z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)�metavarr>r(r?z-sZSTRIPDIRrz�part of path to left-strip from path to source file - for example buildroot. `-d` and `-s` options cannot be specified together.z-pZ
PREPENDDIRrz�path to add as prefix to path to source file - for example / to make it absolute when some part is removed by `-s` option. `-d` and `-p` options cannot be specified together.z-xZREGEXPr$zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILE�flistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rBr>r?�compile_destzFILE|DIRZ*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)rBZnargsr?z-jz	--workersrzRun compileall concurrently)r(rAr?Z_Z-z--invalidation-modez�set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)Zchoicesr?z-o�append�
opt_levelsz�Optimization levels to run compilation with. Default is -1 which uses the optimization level of the Python interpreter itself (see -O).)r=rAr>r?z-eZDIRrz+Ignore symlinks pointing outsite of the DIRz--hardlink-dupesrzHardlink duplicated pyc filesr.�����zYHardlinking of duplicated bytecode makes sense only for more than one optimization level.z.-d cannot be used in combination with -s or -pzutf-8)r9rzError reading file list {}FT)r'rrr&rr)r,r'rrr&rr)r%r#r	r'z
[interrupted])/�argparseZArgumentParserZadd_argumentr0r6ZPycInvalidationModerZlowerZreplacer1Z
parse_argsrDr$�rer7rr@rrFr/rZerrorr"rrrCr*Zstdinr5rEZstriprr	r
rr'Zupperrrr2rr#r%rr,rZKeyboardInterrupt)rHZparserZmodeZinvalidation_modesZargsZ
compile_destsrIrZfZlineZivl_moder'r-r>s              r�mainrJ;s���
�
$�
$�G�%�I�F�
����]�!� $�;�@��B�����3�[�<��>�����\��N��P�
����W�7�A�;��<�����\��O��Q�
����i�v�t�,��.�
����j�
� $�4��6�����l�,� $�4��6�����h�T�4�H��J�����f�7�B��D�����
�#�A��C�����k�1� �'D��F�'1�&D�&D�F�"��)�)�/�/�+�3�3�C��=�F��F�
���-� &�'9� :�7��9�����X�C�l�K��M�����e�/�J��L�
���*�<�-�<��>�����D��%�%�M��w�w���*�*�T�W�W�%������R��!����~�~�!��N�N�	��N�N�	������$���
�4�?�?��q� �T�%8�%8����C�	E��y�y���
�
�!�T�_�_�%@����E�F��z�z�	�#�z�z�3��#�)�)�����g�6�
7�;<��7�D�!�(�(�����6�7�
7�����)�)�1�1�#�s�;�A�A�C��&�:�:�8�D�� ���G� ��%�
(���7�7�>�>�$�'�'�'��i�i����T�W�W�(,�
�
�D�K�K�:K�15���37�?�?�15���6:�6H�6H�7;�7J�7J�L�#(��L�'�t��	�	�'+�z�z�4�7�7�D�J�J�'+�{�{�D�L�L�9J�04�
�
�26�/�/�04���59�5G�5G�6:�6I�6I�K�K�#(��+
(�,�N��t�{�{�$�*�*�&*�j�j�2C�E�
E��uF�`
7�
7���	��z�z�A�~��2�9�9�$�*�*�E�F��	��R���:�:��>��#�$���sU�3S+�4T�4)S0�T�9D:U�8U�)U�0
S?�:T�?T�>U�U�%U.�-U.Z__main__)r)	NNFNrFrGrN)NFNrFrGN)rrFrFrGN)rr*Zimportlib.utilr3r6r4r8Z	functoolsrZpathlibrZ__all__rrrrrJr;r0Zexit_statusZexit)r<r�<module>rKs���
�
���
����
7��.�.7<�EF�"&�R�48��t�E�R�hCD�(*�#'�S�59�d�#�E�S�jAB�(*�#'��DV�r�z���$�&�j�/�K��H�H�[��r<