aY;|UddlmZddlZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z m Z ddlmZmZmZmZdZdZdZhd Zejd0dZd1dZd1dZd2dZejdZded<Gdde Zd3dZ d3dZ!d3dZ"d4d Z#ej$d5d!Z%d6d$Z&ed%d&d'ed%d(d)ed%d*d+iZ'd,ed-<d7d/Z(dS)8) annotationsN) GeneratorIterator NamedTupleSequence)EIClassEIDataELFFileEMachinel~ii>ppc64s390xx86_64aarch64ppc64leriscv64 loongarch64pathstrreturn%Generator[ELFFile | None, None, None]c#K t|d5}t|VddddS#1swxYwYdS#tttf$rdVYdSwxYw)Nrb)openr OSError TypeError ValueError)rfs /builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/packaging/_manylinux.py _parse_elfr s $   !**                      Y + s,A3 A7A7AAA executableboolc<t|5}|duon|jtjkoY|jt jkoD|jtj ko/|j tztko|j tztk cdddS#1swxYwYdSN)r capacityr C32encodingr Lsbmachiner ArmflagsEF_ARM_ABIMASKEF_ARM_ABI_VER5EF_ARM_ABI_FLOAT_HARDr!rs r_is_linux_armhfr0(s J   1 TM I gk) I fj( I X\) I.(O;  I //3HH                    sA4BBBct|5}|duo>|jtjko)|jt jko|jtj k cdddS#1swxYwYdSr$) r r%r r&r'r r(r)r I386r/s r_is_linux_i686r37s J   1 TM + gk) + fj( + X]*                    sAA!!A%(A%archs Sequence[str]cd|vrt|Sd|vrt|Std|DS)Narmv7li686c3(K|] }|tvVdSr$)_ALLOWED_ARCHS).0archs r z'_have_compatible_abi..Fs'88$t~%888888)r0r3any)r!r4s r_have_compatible_abir@AsO5z*** j))) 88%888 8 88r>cdS)N2rCr>rrDNsBr>zdict[int, int]_LAST_GLIBC_MINORc$eZdZUded<ded<dS) _GLibCVersionintmajorminorN)__name__ __module__ __qualname____annotations__rCr>rrGrGQs"JJJJJJJJr>rG str | Nonec tjd}|J|\}}n$#ttt t f$rYdSwxYw|S)zJ Primary implementation of glibc_version_string using os.confstr. CS_GNU_LIBC_VERSIONN)osconfstrrsplitAssertionErrorAttributeErrorrr)version_string_versions r_glibc_version_string_confstrrZVsl%'Z0E%F%F)))#**,, 77 NGZ @tt Ns/2AAc8 ddl}n#t$rYdSwxYw |d}n#t$rYdSwxYw |j}n#t $rYdSwxYw|j|_|}t|ts| d}|S)zG Fallback implementation of glibc_version_string using ctypes. rNascii) ctypes ImportErrorCDLLrgnu_get_libc_versionrVc_char_prestype isinstancerdecode)r]process_namespacer` version_strs r_glibc_version_string_ctypesrgis tt "KK-- tt0E tt $*? ++--K k3 ' '2!((11 s* / ==A AAc:tp tS)z9Returns glibc version string, or None if not using glibc.)rZrgrCr>r_glibc_version_stringris ( * * L.J.L.LLr>rfc.tjd|}|s/tjd|tdt ddSt t |dt |dS)a3Parse glibc version. We use a regexp instead of str.split because we want to discard any random junk that might come after the minor version -- this might happen in patched/forked versions of glibc (e.g. Linaro's version of glibc uses version strings like "2.20-2014.11"). See gh-3588. z$(?P[0-9]+)\.(?P[0-9]+)z;Expected glibc version with 2 components major.minor, got: ) stacklevelrIrJ)rematchwarningswarnRuntimeWarningrGrHgroup)rfms r_parse_glibc_versionrus 8+FFA % W+ W W     R$$$ QWWW--..AGGG4D4D0E0E F FFr>c`t}|tddSt|S)Nrm)rirGru)rfs r_get_glibc_versionrws1'))KR$$$  , ,,r>r<rYc<t}||krdS ddl}n#t$rYdSwxYwt|dr6||d|d|}|t |SdS|t ddkr$t|drt |jS|t dd kr$t|d rt |jS|t dd kr$t|d rt |j SdS) NFrTmanylinux_compatiblerrkmanylinux1_compatible manylinux2010_compatiblemanylinux2014_compatible) rw _manylinuxr^hasattrryr"rGr{r}r)r<rY sys_glibcrresults r_is_compatiblersQ"$$I7u ttz12200WQZNN  << t-1%%%%'*>U*V*V%J4555-2&&&&7.,,&J7888-2&&&&7.,,&J7888 4s  ++rkr~ manylinux2014r| manylinux2010rz manylinux1zdict[_GLibCVersion, str]_LEGACY_MANYLINUX_MAP Iterator[str]c#Kttj|sdStdd}t |ddhzrtdd}tt }|g}t |jdz ddD]2}t|}| t||3|D]}|D]}|j|jkr|j }nd}t |j |dD]]}t|j|} t|| r6d j g| |RVt| x} r | d |V^dS) aGenerate manylinux 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 manylinux-compatible. :returns: An iterator of compatible manylinux tags. Nrkrr8rrmzmanylinux_{}_{}_{}rX)r@sysr!rGsetrwrangerIrEappendrJrformatrget) r4too_old_glibc2 current_glibcglibc_max_list glibc_major glibc_minorr< glibc_max min_minor glibc_version legacy_tags r platform_tagsrs  6 6"1b))N 5zzXv&&-&q!,,!#5#7#78M#_N]014a<<GG ' 4 mKEEFFFF55' 5 5I."666*0  $Y_iDD 5 5 -io{ K K !$ 6655.5K}KdKKKKKK&;%>%>}%M%MMz5!+44d44444 5 555r>)rrrr)r!rrr")r!rr4r5rr")rrO)rfrrrG)rrG)r<rrYrGrr")r4r5rr)) __future__r collections contextlib functoolsrRrnrrptypingrrrr_elffiler r r r r,r-r.r:contextmanagerr r0r3r@ defaultdictrErNrGrZrgriru lru_cacherwrrrrCr>rrsx""""""" <<<<<<<<<<<<888888888888"          9999%