8f dZddlmZddlZddlZddlZddlZddlmZm Z m Z ddl m Z Gdde Z d!d Zejd"dZd#dZedkrddlZejZeds JdedeedeejeddeejddedddD]Zeed dSdS)$zPEP 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 NamedTupleSequence)ELFFilec$eZdZUded<ded<dS) _MuslVersionintmajorminorN)__name__ __module__ __qualname____annotations__/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/packaging/_musllinux.pyr r s"JJJJJJJJrr outputstrreturn_MuslVersion | Nonecdd|DD}t|dks|ddddkrdStjd|d}|sdSt t |dt |d S) Ncg|]}||Srr.0ns r z'_parse_musl_version..s F F F1A FQ F F Frc3>K|]}|VdS)N)striprs r z&_parse_musl_version..s*@@q@@@@@@rrmuslzVersion (\d+)\.(\d+)r)r r ) splitlineslenrematchr r group)rlinesms r_parse_musl_versionr,s F F@@F,=,=,?,?@@@ F F FE 5zzA~~q"1"//t (%(33A t c!''!**ooS__ E E EEr executablec6 t|d5}t|j}dddn #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)stderrtext) openr interpreterOSError TypeError ValueError subprocessrunPIPEr,r0)r-fldprocs r_get_musl_versionr=!s *d # # (q'B ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( Y +tt zV2%%t >2$zT B B BD t{ + ++s'?3 ?7?7?AAarchs Sequence[str] Iterator[str]c#Kttj}|dS|D]-}t|jddD]}d|jd|d|V.dS)aGenerate 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_muslarchr s r platform_tagsrI8s!00H??8>2r22 ? ?E>x~>>>>>> > > > > ???r__main__zlinux-z not linuxzplat:zmusl:ztags: )endz[.-]rD-rBz )rrrr)r-rrr)r>r?rr@)__doc__ __future__r functoolsr'r7rEtypingrrr_elffilerr r, lru_cacher=rIr sysconfig get_platformplat startswithprintr-subsplittrrrr\s #"""""  1111111111: FFFF ,,,,,????& z !9 ! # #D ??8 $ $11k11 $ E'4 E'$$S^44555 E's ]626'3 30B0B20FGG H H!! aZ     !!r