� L�gt � �X�dZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z Gd�de��Z de d ee fd �Zej��d e d ee fd ���Zd e e d ee fd�Zedkr�ddlZej��Ze�d��s Jd���ede��edeej����edd���eejdde�dd��d����D]Zeed����dSdS)z�PEP 656 support. This module implements logic to detect if the currently running Python is linked against musl, and what musl version is used. �N)�Iterator� NamedTuple�Optional�Sequence�)�ELFFilec�$�eZdZUeed<eed<dS)� _MuslVersion�major�minorN)�__name__� __module__� __qualname__�int�__annotations__���d/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/packaging/_musllinux.pyr r s"������� �J�J�J� �J�J�J�J�Jrr �output�returnc��d�d�|���D��D��}t|��dks|ddd�dkrdStjd|d��}|sdSt t |�d����t |�d����� ��S) Nc��g|]}|�|��Srr��.0�ns r� <listcomp>z'_parse_musl_version.<locals>.<listcomp>s�� F� F� F�1�A� F�Q� F� F� Frc3�>K�|]}|���V��dS)N)�striprs r� <genexpr>z&_parse_musl_version.<locals>.<genexpr>s*����@�@�q������@�@�@�@�@�@r�r��muslzVersion (\d+)\.(\d+)r)r r )� splitlines�len�re�matchr r�group)r�lines�ms r�_parse_musl_versionr*s��� F� F�@�@�F�,=�,=�,?�,?�@�@�@� F� F� F�E� �5�z�z�A�~�~��q��"�1�"���/�/��t� ��(�%��(�3�3�A� ���t� �c�!�'�'�!�*�*�o�o�S�������_�_� E� E� E�Er� executablec�6� t|d��5}t|��j}ddd��n #1swxYwYn#ttt f$rYdSwxYw|�d|vrdSt j|gt jd���}t|j ��S)a`Detect currently-running musl runtime version. This is done by checking the specified executable's dynamic linking information, and invoking the loader to parse its output for a version string. If the loader is musl, the output would be something like:: musl libc (x86_64) Version 1.2.2 Dynamic Program Loader �rbNr"T)�stderr�text) �openr� interpreter�OSError� TypeError� ValueError� subprocess�run�PIPEr*r.)r+�f�ld�procs r�_get_musl_versionr;s���� �*�d� #� #� (�q�����'�B� (� (� (� (� (� (� (� (� (� (� (���� (� (� (� (��� �Y� � +�����t�t����� �z�V�2�%�%��t� �>�2�$�z��T� B� B� B�D� �t�{� +� +�+s'�?�3� ?�7�?�7�?�A�A�archsc#�K�ttj��}|�dS|D]-}t|jdd��D]}d|j�d|�d|��V���.dS)a�Generate musllinux tags compatible to the current platform. :param archs: Sequence of compatible architectures. The first one shall be the closest to the actual architecture and be the part of platform tag after the ``linux_`` prefix, e.g. ``x86_64``. The ``linux_`` prefix is assumed as a prerequisite for the current platform to be musllinux-compatible. :returns: An iterator of compatible musllinux tags. N������ musllinux_�_)r;�sysr+�ranger r )r<�sys_musl�archr s r� platform_tagsrE6s�����!���0�0�H������?�?���8�>�2�r�2�2� ?� ?�E�>�x�~�>�>��>�>��>�>� >� >� >� >� ?�?�?r�__main__zlinux-z not linuxzplat:zmusl:ztags:� )�endz[.-]r@�-r>z )�__doc__� functoolsr%r5rA�typingrrrr�_elffilerr �strr*� lru_cacher;rEr � sysconfig� get_platform�plat� startswith�printr+�sub�split�trrr�<module>rXs'���� ���� � � � ����� � � � �;�;�;�;�;�;�;�;�;�;�;�;������������:���� F��F���(>�F�F�F�F������,�#�,�(�<�*@�,�,�,���,�,?��#��?�8�C�=�?�?�?�?�& �z������� !�9� !� #� #�D� �?�?�8� $� $�1�1�k�1�1� $� �E�'�4���� �E�'�$�$�S�^�4�4�5�5�5� �E�'�s����� �]�6�2�6�'�3�� � �3��0B�0B�2�0F�G�G� H� H�!�!�� ��a�Z� � � � � ���!�!r
Memory