§
    ZŠtjÖ
  ã            
      ó  — 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	 ddl
mZ erddlmZ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          ¦  «        g¦  «        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)ÚTYPE_CHECKINGÚ
NamedTupleé   )ÚELFFile)ÚIteratorÚSequencec                  ó$   — 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/CA-Chatbot/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                ó8  — 	 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d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%   FT)ÚcheckÚstderrÚtext)Úopenr   ÚinterpreterÚOSErrorÚ	TypeErrorÚ
ValueErrorÚ
subprocessÚrunÚPIPEr-   r2   )r.   ÚfÚldÚprocs       r   Ú_get_musl_versionr?   $   sá   € ðÝ�*˜dÑ#Ô#ð 	( qÝ˜‘”Ô'ˆBð	(ð 	(ð 	(ñ 	(ô 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(øøøð 	(ð 	(ð 	(ð 	(øøå•Y¥
Ð+ð ð ð Øˆtˆtðøøøà	€z�V 2Ð%Ð%ØˆtÝŒ>˜2˜$ eµJ´OÈ$ÐOÑOÔO€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_tagsrK   ;   s†   è è € õ !¥¤Ñ0Ô0€HØÐØˆØð ?ð ?ˆÝ˜8œ>¨2¨rÑ2Ô2ð 	?ð 	?ˆEØ>˜xœ~Ð>Ð>°Ð>Ð>¸Ð>Ð>Ð>Ð>Ð>Ð>ð	?ð?ð ?r   Ú__main__zlinux-z	not linuxzplat:zmusl:ztags:ú )Úendz[.-]rF   ú-rD   z
      )r   r   r   r   )r.   r   r   r   )r@   rA   r   rB   )Ú__doc__Ú
__future__r   Ú	functoolsr(   r9   rG   Útypingr   r   Ú_elffiler   Úcollections.abcr   r	   r   r-   Ú	lru_cacher?   rK   r   Ú	sysconfigÚget_platformÚplatÚ
startswithÚprintr.   ÚsubÚsplitÚtr   r   r   ú<module>r_      s
  ððð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø 	€	€	€	Ø Ð Ð Ð Ø 
€
€
€
Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,à Ð Ð Ð Ð Ð àð 3Ø2Ð2Ð2Ð2Ð2Ð2Ð2Ð2ðð ð ð ð �:ñ ô ð ð
Fð Fð Fð Fð Ôð,ð ,ð ,ñ Ôð,ð,?ð ?ð ?ð ?ð& ˆzÒÐØÐÐÐà!ˆ9Ô!Ñ#Ô#€DØ�?Š?˜8Ñ$Ô$Ð1Ð1 kÑ1Ô1Ð$à	€Eˆ'�4ÑÔÐØ	€Eˆ'Ð$Ð$ S¤^Ñ4Ô4Ñ5Ô5Ð5Ø	€Eˆ'�sÐÑÔÐØˆ]˜F˜BœF 7¨C°·²¸CÀÑ1CÔ1CÀBÔ1GÑHÔHÐIÑJÔJð !ð !ˆØˆˆa�ZÐ Ñ Ô Ð Ð ð Ðð!ð !r   