HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/packaging/__pycache__/_musllinux.cpython-310.pyc
o

;jt
�	@s.dZddlZddlZddlZddlZddlmZmZmZm	Z	ddl
mZGdd�de�Zde
d	eefd
d�Ze��de
d	eefd
d��Zde	e
d	ee
fdd�Zedkr�ddlZe��Ze�d�shJd��ede�edeej��eddd�ee�dde�dd�d��D]
Zeedd�q�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@seZdZUeed<eed<dS)�_MuslVersion�major�minorN)�__name__�
__module__�__qualname__�int�__annotations__�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/packaging/_musllinux.pyrs
r�output�returncCsxdd�dd�|��D�D�}t|�dks|ddd�dkr dSt�d	|d
�}|s,dStt|�d
��t|�d��d�S)NcSsg|]}|r|�qSrr��.0�nrrr�
<listcomp>sz'_parse_musl_version.<locals>.<listcomp>css�|]}|��VqdS)N)�striprrrr�	<genexpr>s�z&_parse_musl_version.<locals>.<genexpr>�r��muslzVersion (\d+)\.(\d+)r)r	r
)�
splitlines�len�re�matchrr�group)r�lines�mrrr�_parse_musl_versions  r$�
executablec
Cs�zt|d��
}t|�j}Wd�n1swYWn
tttfy)YdSw|dus2d|vr4dStj|gtjdd�}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
    �rbNrT)�stderr�text)�openr�interpreter�OSError�	TypeError�
ValueError�
subprocess�run�PIPEr$r')r%�fZld�procrrr�_get_musl_versions���
r3�archsccsT�ttj�}|durdS|D]}t|jdd�D]}d|j�d|�d|��VqqdS)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���Z
musllinux_�_)r3�sysr%�ranger
r	)r4Zsys_musl�archr
rrr�
platform_tags6s�
��r:�__main__zlinux-z	not linuxzplat:zmusl:ztags:� )�endz[.-]r6�-r5z
      )�__doc__�	functoolsrr.r7�typingrrrrZ_elffilerr�strr$�	lru_cacher3r:r�	sysconfigZget_platform�plat�
startswith�printr%�sub�split�trrrr�<module>s.

"�