hf HdZddlZddlZddlZddlZddlmZmZmZddl m Z GddeZ de d ee fd Z ejd e d ee fd Zd e d ee fdZedkrddlZejZeds JdedeedeejeddeejddedddD]ZeeddSdS)zPEP 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 NamedTupleOptional)ELFFilec$eZdZUeed<eed<dS) _MuslVersionmajorminorN)__name__ __module__ __qualname__int__annotations__t/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/packaging/_musllinux.pyr r s" JJJ JJJJJrr outputreturncdd|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 rgroup)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)stderruniversal_newlines) openr interpreterOSError TypeError ValueError subprocessrunPIPEr)r-)r*fldprocs r_get_musl_versionr:s *d # # (q'B ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( Y +tt zV2%%t >2$z4 P P PD t{ + ++s'?3 ?7?7?AAarchc#Kttj}|dSt|jddD]}d|jd|d|VdS)aTGenerate musllinux tags compatible to the current platform. :param arch: Should 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_muslr s r platform_tagsrC6sr!00Hx~r2..;;:8>::E::D::::::;;r__main__zlinux-z not linuxzplat:zmusl:ztags: )endz[.-]r?-r=z )__doc__ functoolsr$r4r@typingrrr_elffilerr strr) lru_cacher:rCr sysconfig get_platformplat startswithprintr*subsplittrrrrVs   1111111111: FF(>FFFF,#,(<*@,,,,, ; ; ; ; ; ;  z !9 ! # #D ??8 $ $11k11 $ E'4 E'$$S^44555 E's ]626'3 30B0B20FGG H H!! aZ     !!r