� ,�ReP��b�ddlmZddlmZddlmZddlZddlZddlm Z Gd�de ��Z dS)�)� convert_path)�log)�DistutilsOptionErrorN)�Commandc�4�eZdZdZdZgd�ZgZd�Zd�Zd�Z dS)�rotatezDelete older distributionsz2delete older distributions, keeping N newest files))zmatch=�mzpatterns to match (required))z dist-dir=�dz%directory where the distributions are)zkeep=�kz(number of matching distributions to keepc�0�d|_d|_d|_dS)N)�match�dist_dir�keep)�selfs ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/rotate.py�initialize_optionszrotate.initialize_optionss���� ��� ��� � � �c��|j�td���|j�td��� t|j��|_n"#t$r}td��|�d}~wwxYwt |jt ��r)d�|j�d��D��|_|�dd��dS)NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integerc�P�g|]#}t|�������$S�)r�strip)�.0�ps r� z+rotate.finalize_options..(s5�����,-� �Q�W�W�Y�Y�'�'���r�,�bdist)rr) r rr�int� ValueError� isinstance�str�split�set_undefined_options)r�es r�finalize_optionszrotate.finalize_optionss��� �:� �&�*��� � �9� �&�'M�N�N� N� K��D�I���D�I�I��� K� K� K�&�'B�C�C�� J����� K���� �d�j�#� &� &� ���15��1A�1A�#�1F�1F����D�J� �"�"�7�,D�E�E�E�E�Es�A� A'�A"�"A'c��|�d��ddlm}|jD�]"}|j���dz|z}|t j�|j|����}d�|D��}|� ��|� ��tj dt|��|��||jd�}|D]i\}}tj d|��|jsHt j�|��rt#j|���Ut j|���j��$dS)N�egg_infor)�glob�*c�P�g|]#}tj�|��|f��$Sr)�os�path�getmtime)r�fs rrzrotate.run..4s-��=�=�=�!�b�g�&�&�q�)�)�1�-�=�=�=rz%d file(s) matching %sz Deleting %s)� run_commandr'r � distribution�get_namer*r+�joinr�sort�reverser�info�lenr�dry_run�isdir�shutil�rmtree�unlink)rr'�pattern�files�tr-s r�runz rotate.run-sE�� ����$�$�$��������z� %� %�G��'�0�0�2�2�S�8�7�B�G��D�����d�m�W�=�=�>�>�E�=�=�u�=�=�=�E� �J�J�L�L�L� �M�M�O�O�O� �H�-�s�5�z�z�7� C� C� C��$�)�*�*�%�E�� %� %���A�����*�*�*��|�%��w�}�}�Q�'�'�%�� �a�(�(�(�(�� �!� � � ��  %� %� %rN) �__name__� __module__� __qualname__�__doc__� description� user_options�boolean_optionsrr$r>rrrrr sg������$�$�F�K����L� �O���� F�F�F�$%�%�%�%�%rr) �distutils.utilr� distutilsr�distutils.errorsrr*r8� setuptoolsrrrrr�rJs���'�'�'�'�'�'�������1�1�1�1�1�1� � � � � � � � �������6%�6%�6%�6%�6%�W�6%�6%�6%�6%�6%r