Your IP : 216.73.216.158


Current Path : /snap/certbot/5528/lib64/python3.12/site-packages/packaging/__pycache__/
Upload File :
Current File : //snap/certbot/5528/lib64/python3.12/site-packages/packaging/__pycache__/_musllinux.cpython-312.pyc

�

`I�i�
�
���dZddlmZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlmZGd�de	�Z
dd	�Zejdd
��Zdd�Zedk(r�ddlZej(�Zej-d
�sJd��ede�edeej0��edd��eej2ddej5dd�d��D]Zeed���yy)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.
�)�annotationsN)�Iterator�
NamedTuple�Sequence�)�ELFFilec�"�eZdZUded<ded<y)�_MuslVersion�int�major�minorN)�__name__�
__module__�__qualname__�__annotations__����/build/snapcraft-certbot-53a6961353a63169611ae8a78f6bfa4f/parts/certbot/install/lib/python3.12/site-packages/packaging/_musllinux.pyr
r
s���J��Jrr
c�@�d�|j�D�D�cgc]}|s�|��	}}t|�dks|ddddk7rytjd|d�}|syt	t|j
d��t|j
d����Scc}w)	Nc3�<K�|]}|j����y�w)N)�strip)�.0�ns  r�	<genexpr>z&_parse_musl_version.<locals>.<genexpr>s����@�q�����@�s��r��muslzVersion (\d+)\.(\d+)r)rr
)�
splitlines�len�re�matchr
r�group)�outputr�lines�ms    r�_parse_musl_versionr&s���@�F�,=�,=�,?�@�F�1�A�Q�F�E�F�
�5�z�A�~��q��"�1���/��
���(�%��(�3�A����c�!�'�'�!�*�o�S������_�E�E��

Gs
�B�Bc�,�	t|d�5}t|�j}ddd��d|vryt
j|gdtjd��}t|j�S#1swY�MxYw#ttt
f$rYywxYw)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
    �rbNrFT)�check�stderr�text)�openr�interpreter�OSError�	TypeError�
ValueError�
subprocess�run�PIPEr&r*)�
executable�f�ld�procs    r�_get_musl_versionr8!s����
�*�d�
#�	(�q����'�'�B�	(�
�z�V�2�%���>�>�2�$�e�J�O�O�$�O�D��t�{�{�+�+�	(�	(���Y�
�+����s'�A<�A0�A<�0A9�5A<�<B�Bc#�K�ttj�}|�y|D]5}t|jdd�D]}d|j
�d|�d|������7y�w)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_�_)r8�sysr4�ranger
r)�archs�sys_musl�archr
s    r�
platform_tagsrB8sh����!����0�H�����?���8�>�>�2�r�2�	?�E��x�~�~�.�a��w�a��v�>�>�	?�?�s�AA�__main__zlinux-z	not linuxzplat:zmusl:ztags:� )�endz[.-]r<�-r:z
      )r#�str�return�_MuslVersion | None)r4rGrHrI)r?z
Sequence[str]rHz
Iterator[str])�__doc__�
__future__r�	functoolsr r1r=�typingrrr�_elffilerr
r&�	lru_cacher8rBr�	sysconfig�get_platform�plat�
startswith�printr4�sub�split�trrr�<module>rXs����#��	��
�1�1���:��
F����,��,�,?�&�z���!�9�!�!�#�D��?�?�8�$�1�k�1�$�	�'�4��	�'�$�S�^�^�4�5�	�'�s��
�6�2�6�6�'�3��
�
�3��0B�2�0F�G�
H�!��
�a�Z� �!�r