HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/wheel/cli/__pycache__/convert.cpython-310.pyc
o

�N�gZ1�@s~ddlmZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZddlmZd
dlmZd
dlmZd
dlmZd
dl m!Z!e�"dej#�Z$e�"dej#�Z%e�"d�Z&e�"d�Z'edddd�Z(de��Z)d8d d!�Z*d9d#d$�Z+d:d&d'�Z,Gd(d)�d)ed*�Z-Gd+d,�d,e-�Z.Gd-d.�d.e.�Z/Gd/d0�d0e-�Z0d;d6d7�Z1dS)<�)�annotationsN)�ABCMeta�abstractmethod)�defaultdict)�Iterator)�Message)�Parser)�EmailPolicy)�iglob)�Path)�dedent)�ZipFile�)�__version__)�generate_requirements)�	parse_tag)�	WheelFilez]
    (?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
     (-(?P<arch>.+?))?
    )?.egg$zL
    ^(?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
    )?.egg-info/z>\.(?P<platform>win32|win-amd64)(?:-(?P<pyver>py\d\.\d))?\.exe$z8\.(?P<abi>[a-z0-9]+)-(?P<platform>win32|win_amd64)\.pyd$TF)�utf8�mangle_from_�max_line_lengthzwheel �requires�str�metadatar�return�NonecCszd}tt�}|��D]!}|��}|sq
|�d�r$|�d�r$|dd�}q
||�|�q
t|�D]
\}}|�||�q0dS)N�[�]����)	r�list�
splitlines�strip�
startswith�endswith�appendr�
add_header)rr�extraZrequirements�line�key�value�r*�E/opt/saltstack/salt/lib/python3.10/site-packages/wheel/cli/convert.py�convert_requires0s�r,�pkginfoc
Cs�t��|�}|��D]R\}}|��}|dkrq
|dkr:|��}d�|d��td�|dd���df�}|�|�q
|dkrH|�	dd|���q
|d	krV|�	dd
|���q
|�	||�q
|�
dd�dS)
N�UNKNOWN�description�
rrz	home-pagezProject-URLz
Homepage, zdownload-urlz
Download, zMetadata-Versionz2.4)r�parsestr�items�lowerr �join�lstripr�set_payloadr%�replace_header)r-rZparsed_messager(r)Z	key_lowerZdescription_linesr*r*r+�convert_pkg_infoBs(
��r8�namecCst�dd|����dd�S)Nz[-_.]+�-�_)�re�subr3�replace)r9r*r*r+�	normalize]sr?c@sfeZdZUded<ded<dZded<dZded<dZded	<d
ed<edd
d��Ze	ddd��Z
dS)�
ConvertSourcerr9�versionzpy2.py3�pyverZnone�abi�any�platformrrrcCs|j�d|j�d�S)Nr:�
.dist-info)r9rA��selfr*r*r+�
dist_info_diriszConvertSource.dist_info_dir�Iterator[tuple[str, bytes]]cCsdS�Nr*rGr*r*r+�generate_contentsmszConvertSource.generate_contentsN)rr�rrJ)�__name__�
__module__�__qualname__�__annotations__rBrCrE�propertyrIrrLr*r*r*r+r@as
r@)�	metaclassc@s eZdZd
dd�Zddd�Zd	S)�
EggFileSource�pathrcCs�t�|j�}std|j����||_t|�d��|_|�d�|_|�d�}rC|�dd�|_	|�d�}rC|j	�dd	�|_
t|�|_t�|_
dS)
NzInvalid egg file name: r9�verrB�.��arch�pyZcp)�egg_filename_re�matchr9�
ValueErrorrUr?�grouprAr>rBrCrErr)rHrUr\rBrYr*r*r+�__init__ss
zEggFileSource.__init__rrJccs��t|jd��\}t|���D]L}|�d�rq|�d�rR|dkr.|�|��d�}t||j	�n#|dkrA|�|��d�}t
||j	�n|dkrQ|j�d�|�|�fVq||�|�fVqWd�dS1sfwYdS)	N�r�/z	EGG-INFO/zEGG-INFO/requires.txt�utf-8zEGG-INFO/PKG-INFOzEGG-INFO/entry_points.txt�/entry_points.txt)r
rU�sorted�namelistr#r"�read�decoder,rr8rI)rH�zip_file�filenamerr-r*r*r+rL�s(�


��"�zEggFileSource.generate_contentsN�rUrrM)rNrOrPr_rLr*r*r*r+rTrs
rTc@seZdZddd�ZdS)�EggDirectorySourcerrJc
cs��t�|j�D]o\}}}t|�D]e}t||�}|jjdkrh|jdkr.|�d�}t||j	�n9|jdkrW|�d�}t
||j	�|j	�d�}rKt|�|_|j	�d�}	rV|	|_
n|jdkrg|j�d�|��fVqt|�|j��|��fVqqdS)	NzEGG-INFO�requires.txtrb�PKG-INFO�NameZVersion�entry_points.txtrc)�os�walkrUrdr�parentr9�	read_textr,rr8�getr?rArI�
read_bytesr�relative_to)
rH�dirpathr;�	filenamesrirUrr-r9rAr*r*r+rL�s0�





�

���z$EggDirectorySource.generate_contentsNrM)rNrOrPrLr*r*r*r+rk�srkc@s$eZdZdZddd�Zddd	�Zd
S)
�WininstFileSourcea�
    Handles distributions created with ``bdist_wininst``.

    The egginfo filename has the format::

        name-ver(-pyver)(-arch).egg-info

    The installer filename has the format::

        name-ver.arch(-pyver).exe

    Some things to note:

    1. The installer filename is not definitive. An installer can be renamed
       and work perfectly well as an installer. So more reliable data should
       be used whenever possible.
    2. The egg-info data should be preferred for the name and version, because
       these come straight from the distutils metadata, and are mandatory.
    3. The pyver from the egg-info data should be ignored, as it is
       constructed from the version of Python used to build the installer,
       which is irrelevant - the installer filename is correct here (even to
       the point that when it's not there, any version is implied).
    4. The architecture must be taken from the installer filename, as it is
       not included in the egg-info data.
    5. Architecture-neutral installers still have an architecture because the
       installer format itself (being executable) is architecture-specific. We
       should therefore ignore the architecture if the content is pure-python.
    rUrc	Cs:||_t�|_t�|j�}r%t|�d��|_|�d�}r%|�	dd�|_
d}}t|j��e}|��D]O}|�
dd�\}}|set�|�}red}t|�d	��|_|�d
�|_|�d�}rd|�	dd�|_
n|s|t�|�}r|d}|�d�|_|�d�|_|r�|r�n	q3Wd�dSWd�dS1s�wYdS)NrErBrWrXFrarTr9rVrC)rUrr�
wininst_re�searchr9r?r^rEr>rBr
re�split�egg_info_rer\rA�pyd_rerC)	rHrUr\rBZegg_info_foundZ	pyd_foundrhri�prefixr*r*r+r_�s8����"�zWininstFileSource.__init__rrJc
cs6�|j�d|j�d�}|j�d|j�d�}t|jd��v}t|���D]f}|�d�r*q"|�dd�\}}t�	|�ru|�
dd�d}|dkrR|�|��d	�}t
||j�n"|d
kre|�|��d	�}	t|	|j�n|dkrt|�d�|�|�fVq"|d
kr�|�d|��}||�|�fVq"Wd�dS1s�wYdS)Nr:rFz.datar`rarrrlrbrmrorcZSCRIPTSz	/scripts/)r9rAr
rUrdrer#r|r}r{�rsplitrfrgr,rr8)
rHrIZdata_dirrhrirZtarget_filename�basenamerr-r*r*r+rL�s4�

��"�z#WininstFileSource.generate_contentsNrjrM)rNrOrP�__doc__r_rLr*r*r*r+ry�s
ry�files�	list[str]�dest_dir�verbose�boolc
Cs�|D]�}t|�D]�}t|�}|jdkr!|��rt|�}n	t|�}nt|�}|r1t|�d�ddd�t|�|j�d|j	�d|j
�d|j�d|j�d�
}t
|d��x}|��D]
\}	}
|�|	|
�qU|�|j�d	�|jjtd
��d��t�}|�dd
�|�dt�|�dt|jdk����t|j
�d|j�d|j���}t|dd�d�D]
}
|�dt|
��q�|�|j�d�|jtd
��d��Wd�n1s�wY|r�td�qqdS)Nz.eggz...TrX)�flush�endr:z.whl�wz	/METADATA)�policyrbz
Wheel-Versionz1.0�	GeneratorzRoot-Is-PurelibrDcSs|jSrK)�interpreter)�tagr*r*r+�<lambda>Aszconvert.<locals>.<lambda>)r(ZTagz/WHEEL�OK)r
r�suffix�is_dirrkrTry�printr9rArBrCrErrLZwritestrrIr�	as_string�serialization_policy�encoderr%�	GENERATORrr3rrd)r�r�r��pat�archiverU�source�	dest_path�	wheelfileZ
name_or_zinfo�contentsZ
wheel_message�tagsr�r*r*r+�convertsZ


 ��
���
������r�)rrrrrr)r-rrr)r9rrr)r�r�r�rr�r�rr)2Z
__future__rZos.pathrpr<�abcrr�collectionsr�collections.abcr�
email.messager�email.parserr�email.policyr	�globr
�pathlibr�textwrapr�zipfiler
rXrrrZvendored.packaging.tagsrr�r�compile�VERBOSEr[r}rzr~r�r�r,r8r?r@rTrkryr�r*r*r*r+�<module>sV���
�



-^