§
    ÇÁ³g†
  ã            
      ó  — d Z ddlmZ ddlZddlZddlZddlZddlmZm	Z	m
Z
 ddlmZ  G d„ de	¦  «        Zd!d„Zej        d"d„¦   «         Zd#d„Zedk    rªddlZ ej        ¦   «         Ze                     d¦  «        s
J d¦   «         ‚ ede¦  «          ed eej        ¦  «        ¦  «          edd¬¦  «          e ej        dde                     dd¦  «        d         ¦  «        ¦  «        D ]Z eed ¬¦  «         ŒdS dS )$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                  ó$   — e Zd ZU ded<   ded<   dS )Ú_MuslVersionÚintÚmajorÚminorN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© ó    úR/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/packaging/_musllinux.pyr
   r
      s"   € € € € € € Ø€J€J�JØ€J€J�J€J€Jr   r
   ÚoutputÚstrÚreturnú_MuslVersion | Nonec                ó„  — d„ d„ |                       ¦   «         D ¦   «         D ¦   «         }t          |¦  «        dk     s|d         d d…         dk    rd S t          j        d|d         ¦  «        }|sd S t	          t          |                     d¦  «        ¦  «        t          |                     d¦  «        ¦  «        ¬	¦  «        S )
Nc                ó   — g | ]}|¯|‘ŒS r   r   ©Ú.0Úns     r   ú
<listcomp>z'_parse_musl_version.<locals>.<listcomp>   s   € ÐFÐFÐF�1ÀAÐFˆQÐFÐFÐFr   c              3  ó>   K  — | ]}|                      ¦   «         V — Œd S )N)Ústripr   s     r   ú	<genexpr>z&_parse_musl_version.<locals>.<genexpr>   s*   è è € Ð@Ð@ q˜Ÿš™œÐ@Ð@Ð@Ð@Ð@Ð@r   é   r   é   ÚmuslzVersion (\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        }ddd¦  «         n# 1 swxY w Y   n# t          t          t
          f$ r Y dS w xY w|�d|vrdS t          j        |gt          j        d¬¦  «        }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,   r0   )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ÚarchsúSequence[str]úIterator[str]c              #  ó¤   K  — t          t          j        ¦  «        }|€dS | D ]-}t          |j        dd¦  «        D ]}d|j        › d|› d|› �V — ŒŒ.dS )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_tagsrI   8   s†   è è € õ !¥¤Ñ0Ô0€HØÐØˆØð ?ð ?ˆÝ˜8œ>¨2¨rÑ2Ô2ð 	?ð 	?ˆEØ>˜xœ~Ð>Ð>°Ð>Ð>¸Ð>Ð>Ð>Ð>Ð>Ð>ð	?ð?ð ?r   Ú__main__zlinux-z	not linuxzplat:zmusl:ztags:ú )Úendz[.-]rD   ú-rB   z
      )r   r   r   r   )r-   r   r   r   )r>   r?   r   r@   )Ú__doc__Ú
__future__r   Ú	functoolsr'   r7   rE   Útypingr   r   r   Ú_elffiler   r
   r,   Ú	lru_cacher=   rI   r   Ú	sysconfigÚget_platformÚplatÚ
startswithÚprintr-   ÚsubÚsplitÚtr   r   r   ú<module>r\      sí  ððð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø 	€	€	€	Ø Ð Ð Ð Ø 
€
€
€
Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1à Ð Ð Ð Ð Ð ðð ð ð ð �:ñ ô ð ð
Fð Fð Fð Fð Ôð,ð ,ð ,ñ Ôð,ð,?ð ?ð ?ð ?ð& ˆzÒÐØÐÐÐà!ˆ9Ô!Ñ#Ô#€DØ�?Š?˜8Ñ$Ô$Ð1Ð1 kÑ1Ô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   