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__/pack.cpython-310.pyc
o

�N�g�@svddlmZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZe�d�Zddd�Zddd�ZdS)�)�annotationsN)�BytesGenerator)�BytesParser)�
WheelError)�	WheelFilez6^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$�	directory�str�dest_dir�build_number�
str | None�return�Nonecs��fdd�t���D�}t|�dkrtd�����|s"td�����|d}t�|��d�}tj��|d�}t	|d	��'}t
tjj
d
��|�}|�dg�}	|�d�}
|	s[td
|�d���Wd�n1sewY|durp|n|
}|dur�|d=|r�||d<|d|7}||
kr�t	|d��}t|dd��|�Wd�n1s�wYt|	�}tj�||�d|�d��}t|d��}
td|�d�ddd�|
���Wd�n1s�wYtd�dS)aBRepack a previously unpacked wheel directory into a new wheel file.

    The .dist-info/WHEEL file must contain one or more tags so that the target
    wheel file name can be determined.

    :param directory: The unpacked wheel directory
    :param dest_dir: Destination directory (defaults to the current directory)
    cs0g|]}tj�tj��|��rt�|�r|�qS�)�os�path�isdir�join�DIST_INFO_RE�match)�.0�fn�rr�B/opt/saltstack/salt/lib/python3.10/site-packages/wheel/cli/pack.py�
<listcomp>s���zpack.<locals>.<listcomp>�z)Multiple .dist-info directories found in z#No .dist-info directories found in rZnameverZWHEEL�rb)�policyZTagZBuildzNo tags present in z./WHEEL; cannot determine target wheel filenameN�-�wb)�maxheaderlenz.whl�wzRepacking wheel as z...�T)�end�flush�OK)r�listdir�lenrrr�grouprr�openr�emailr�compat32�parse�get_all�getr�flatten�compute_tagliner�printZwrite_files)rr	r
Zdist_info_dirsZ
dist_info_dirZname_versionZwheel_file_path�f�info�tagsZexisting_build_numberZtagline�
wheel_pathZwfrrr�packsJ

�

�����r5r3�	list[str]cCsXtdd�|D��}tdd�|D��}tdd�|D��}d�d�|�d�|�d�|�g�S)zcCompute a tagline from a list of tags.

    :param tags: A list of tags
    :return: A tagline
    cS�h|]	}|�d�d�qS)rr��split�r�tagrrr�	<setcomp>R�z"compute_tagline.<locals>.<setcomp>cSr7)rrr8r:rrrr<Sr=cSr7)r�r8r:rrrr<Tr=r�.)�sortedr)r3ZimplsZabiversZ	platformsrrrr/Ls"r/)rrr	rr
rrr
)r3r6rr)Z
__future__r�email.policyr)Zos.pathr�re�email.generatorr�email.parserrZ	wheel.clirZwheel.wheelfiler�compilerr5r/rrrr�<module>s

=