Ë
    òT•jµ  ã                   óD   — d Z ddlZddlZd
d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd	„ Z	y)zShared AIX support functions.é    Nc                 ó.  — ddl }ddl}t        d|j                  «       ›�d«      }|j	                  |«      5 }|r| ›d|j
                  ›d�}n| ›d|j
                  ›d�}|j                  |«      s|j                  «       ndcddd«       S # 1 sw Y   yxY w)	z0Output from successful command execution or Noner   Nz/tmp/_aix_support.zw+bz >'z' 2>&1z 2>/dev/null >'ú')ÚosÚ
contextlibÚopenÚgetpidÚclosingÚnameÚsystemÚread)ÚcommandstringÚcapture_stderrr   r   ÚfpÚcmds         ú#/usr/lib/python3.12/_aix_support.pyÚ_read_cmd_outputr      s€   € ó
 ÛÝ	Ø
�	‰	ŒðØó
€Bð 
×	Ñ	˜BÓ	ð 9 2ÙÚ%2°B·G³GÐ<‰Câ,9¸2¿7»7ÐCˆCØ "§	¡	¨#¤ˆr�w‰wŒy°D÷9÷ 9ò 9ús   ·A
BÂBc                 ó~   — t         j                  dk(  rdnd}|dk7  r|nd}dj                  | d   | d   | d   ||«      S )	Niÿÿÿé    é@   r   é'  zaix-{:1x}{:1d}{:02d}-{:04d}-{}é   é   )ÚsysÚmaxsizeÚformat)ÚvrtlÚbdÚ_szÚ_bds       r   Ú_aix_tagr       sI   € ô —‘ Ò(‰"¨b€CØ�a’‰"˜T€Cà+×2Ñ2°4¸±7¸DÀ¹GÀTÈ!ÁWÈcÐSVÓWÐWó    c                 óx   — | j                  d«      d d \  }}}t        |d   «      t        |«      t        |«      gS )Nú.é   éÿÿÿÿ)ÚsplitÚint)ÚvrmfÚvÚrÚtls       r   Ú	_aix_vrtlr,   $   s9   € à�z‰z˜#‹˜r Ð"�H€A€qˆ"Ü��"‘‹Jœ˜A›¤ B£Ð(Ð(r!   c                  ó  — 	 ddl } | j                  g d¢«      }|j	                  d«      }|j                  «       j                  d«      }|d   dk7  rt        |d   «      nd	}t        |d
   «      |fS # t        $ r t        d«      }Y Œnw xY w)a(  
    Return a Tuple[str, int] e.g., ['7.1.4.34', 1806]
    The fileset bos.rte represents the current AIX run-time level. It's VRMF and
    builddate reflect the current ABI levels of the runtime environment.
    If no builddate is found give a value that will satisfy pep425 related queries
    r   N)z/usr/bin/lslppz-Lqczbos.rtez/usr/bin/lslpp -Lqc bos.rtezutf-8ú:r%   Ú r   r   )	Ú
subprocessÚcheck_outputÚImportErrorr   ÚdecodeÚstripr&   r'   Ústr)r0   Úoutr   s      r   Ú_aix_bos_rter7   *   s‰   € ð>ÛØ×%Ñ%Ò&KÓLˆð �*‰*�WÓ
€CØ
�)‰)‹+×
Ñ
˜CÓ
 €CØ˜b™' Rš-Œ#ˆc�"‰gŒ,¨T€CÜ��A‘‹K˜ÐÐøô ò >ÜÐ<Ó=Šð>ús   ‚A1 Á1BÂBc                  óF   — t        «       \  } }t        t        | «      |«      S )a¨  
    AIX filesets are identified by four decimal values: V.R.M.F.
    V (version) and R (release) can be retrieved using ``uname``
    Since 2007, starting with AIX 5.3 TL7, the M value has been
    included with the fileset bos.rte and represents the Technology
    Level (TL) of AIX. The F (Fix) value also increases, but is not
    relevant for comparing releases and binary compatibility.
    For binary compatibility the so-called builddate is needed.
    Again, the builddate of an AIX release is associated with bos.rte.
    AIX ABI compatibility is described  as guaranteed at: https://www.ibm.com/    support/knowledgecenter/en/ssw_aix_72/install/binary_compatability.html

    For pep425 purposes the AIX platform tag becomes:
    "aix-{:1x}{:1d}{:02d}-{:04d}-{}".format(v, r, tl, builddate, bitsize)
    e.g., "aix-6107-1415-32" for AIX 6.1 TL7 bd 1415, 32-bit
    and, "aix-6107-1415-64" for AIX 6.1 TL7 bd 1415, 64-bit
    )r7   r    r,   )r(   r   s     r   Úaix_platformr9   ?   s    € ô& ‹~�H€Dˆ"Ü”I˜d“O RÓ(Ð(r!   c                  ó^   — t        j                  d«      } | st        d«      ‚t        | ¬«      S )NÚBUILD_GNU_TYPEzBUILD_GNU_TYPE is not defined)r(   )Ú	sysconfigÚget_config_varÚ
ValueErrorr,   )Úgnu_types    r   Ú_aix_bgtr@   W   s-   € ä×'Ñ'Ð(8Ó9€HÙÜÐ8Ó9Ð9Ü˜(Ô#Ð#r!   c                  ó®   — t        j                  d«      } 	 t        | «      } t        t        «       | «      S # t        t        f$ r t        d| ›�«      ‚w xY w)zD
    Return the platform_tag of the system Python was built on.
    ÚAIX_BUILDDATEz)AIX_BUILDDATE is not defined or invalid: )r<   r=   r'   r>   Ú	TypeErrorr    r@   )Ú
build_dates    r   Úaix_buildtagrE   _   sc   € ô ×)Ñ)¨/Ó:€Jð,Ü˜“_ˆ
ô ”H“J 
Ó+Ð+øô œ	Ð"ò ,ÜÐDØ&˜>ð+ó ,ð 	,ð,ús	   —6 ¶A)F)
Ú__doc__r   r<   r   r    r,   r7   r9   r@   rE   © r!   r   ú<module>rH      s2   ðÙ #ã 
Û ó9ò$Xò)òò*)ò0$ó,r!   