R`i Z d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl m Z mZmZm Z mZ de e dedeedf fdZde e de e fd Z G d de Zdede e fd Z ej, dede e fd Zdedee fdZedk( rddlZ ej6 Zej; d sJ d ede ed eej> edd e ej@ ddejC dd d D ] Z" ee"d yy) 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)IOIterator NamedTupleOptionalTupleffmtreturn.c r t j || j t j | S N)structunpackreadcalcsize)r r s /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/packaging/_musllinux.py_read_unpackedr s% ==affV__S%9:;; c | j d t | d }|dd t d k7 ry| j t j d d dd d |d \ }}}t j | } t | | \ }}}}}}} t | dz D ] } | j ||| z z |t | | \ }}} |dk7 r7| j | t j | j | j d }d |vr y|c S y# t j $ r Y yw xY w# t $ r Y yw xY w# t j $ r Y yw xY w# t j $ r Y yw xY w)zDetect musl libc location by parsing the Python executable. Based on: https://gist.github.com/lyssdod/f51579ae8d93c8657a5564aefc2ffbca ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html r 16BN s ELFHHI )IIIIHHHIIIIIIII)r r r )QQQIHHHIIQQQQQQ)r )r r musl)seekr r errortupler operator itemgetterKeyErrorrangeosfsdecoder strip)r idente_fmtp_fmtp_idxp_get_e_phoffe_phentsizee_phnumip_typep_offsetp_fileszinterpreters r _parse_ld_musl_from_elfr: s FF1Iq%( RayE*%%FF6??5!1%, 21 (ue ##U+4B1e4L17Aq![' 7Q; wq() ).~a/G)H&FHh Q; xkk!&&"2399$?$ K <<