a XC?h= ã @ sp d Z ddlZddlZzddlZW n ey: ddlZY n0 dd„ Zdd„ Zdd„ Zd d „ Z dd„ Z d d„ ZdS )zShared AIX support functions.é Nc C s@ t jdkrdnd}|dkr|nd}d | d | d | d ||¡S ) Niÿÿÿé é@ r é' zaix-{:1x}{:1d}{:02d}-{:04d}-{}é é )ÚsysÚmaxsizeÚformat)ZvrtlÚbdZ_szÚ_bd© r ú1/opt/alt/python39/lib64/python3.9/_aix_support.pyÚ_aix_tag s r c C s2 | d¡d d… \}}}t|d ƒt|ƒt|ƒgS )NÚ.é éÿÿÿÿ)ÚsplitÚint)ÚvrmfÚvÚrZtlr r r Ú _aix_vrtl s r c C sR t g d¢¡} | d¡} | ¡ d¡} | d dkr>t| d ƒnd}t| d ƒ|fS )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 )z/usr/bin/lslppz-Lqczbos.rtezutf-8ú:r Ú r r )Ú subprocessZcheck_outputÚdecodeÚstripr r Ústr)Úoutr r r r Ú_aix_bos_rte s r c C s t ƒ \} }tt| ƒ|ƒS )a¨ AIX filesets are identified by four decimal values: V.R.M.F. V (version) and R (release) can be retreived 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 )r r r )r r r r r Úaix_platform. s r c C s t d¡} | stdƒ‚t| d�S )NZBUILD_GNU_TYPEzBUILD_GNU_TYPE is not defined)r )Ú sysconfigÚget_config_varÚ ValueErrorr )Zgnu_typer r r Ú_aix_bgtF s r$ c C sH t d¡} zt| ƒ} W n$ ttfy: td| ›�ƒ‚Y n0 ttƒ | ƒS )zD Return the platform_tag of the system Python was built on. Z AIX_BUILDDATEz)AIX_BUILDDATE is not defined or invalid: )r! r" r r# Ú TypeErrorr r$ )Z build_dater r r Úaix_buildtagN s ÿr&