o
    5‘ði  ã                   @   sx   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ dd	lmZ dd
lmZ G dd„ deƒZdS )z·distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).é    N)Úlog)ÚClassVaré   )ÚCommand)Úensure_relativeÚremove_tree)ÚDistutilsPlatformError)Úget_python_version)Úget_platformc                	   @   sr   e Zd ZU dZddddeƒ › d�fddd	d
dddg	Zg d¢Zeee	  e
d< dddœZdd„ Zdd„ Zdd„ ZdS )Ú
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=Údz1temporary directory for creating the distributionz
plat-name=Úpz8platform name to embed in generated filenames [default: ú])zformat=Úfz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))ú	keep-tempÚkzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r   z-directory to put final built distributions in)ú
skip-buildNz2skip rebuilding everything (for testing/debugging))ÚrelativeNz7build the archive using relative paths [default: false])zowner=Úuz@Owner name used when creating a tar file [default: current user])zgroup=ÚgzAGroup name used when creating a tar file [default: current group])r   r   r   Úboolean_optionsÚgztarÚzip)ÚposixÚntc                 C   s:   d | _ d | _d | _d| _d | _d | _d| _d | _d | _d S )NF)	Ú	bdist_dirÚ	plat_nameÚformatÚ	keep_tempÚdist_dirÚ
skip_buildr   ÚownerÚgroup)Úself© r$   úg/root/parts/websockify/install/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_dumb.pyÚinitialize_options>   s   
zbdist_dumb.initialize_optionsc                 C   sv   | j d u r|  d¡j}tj |d¡| _ | jd u r1z	| jtj | _W n t	y0   t
dtj› �ƒ‚w |  dddd¡ d S )NÚbdistÚdumbz>don't know how to create dumb built distributions on platform )r   r   )r   r   )r    r    )r   Úget_finalized_commandÚ
bdist_baseÚosÚpathÚjoinr   Údefault_formatÚnameÚKeyErrorr   Úset_undefined_options)r#   r*   r$   r$   r%   Úfinalize_optionsI   s&   

ÿÿÿüzbdist_dumb.finalize_optionsc                 C   s"  | j s|  d¡ | jddd�}| j|_| j |_ d|_t d| j¡ |  d¡ | j 	¡ › d| j
› �}tj | j|¡}| js@| j}n#| j ¡ rX|j|jkrXtd|j›d	|j›d
�ƒ‚tj | jt|jƒ¡}| j|| j|| j| jd�}| j ¡ rytƒ }nd}| jj d||f¡ | js�t| jƒ d S d S )NÚbuildÚinstallT)Úreinit_subcommandsFzinstalling to %sÚ.zLcan't make a dumb built distribution where base and platbase are different (z, ú))Úroot_dirr!   r"   Úanyr   )r    Úrun_commandÚreinitialize_commandr   ÚrootÚwarn_dirr   ÚinfoÚdistributionÚget_fullnamer   r+   r,   r-   r   r   Úhas_ext_modulesÚinstall_baseÚinstall_platbaser   r   Úmake_archiver   r!   r"   r	   Ú
dist_filesÚappendr   r   )r#   r4   Úarchive_basenameÚpseudoinstall_rootÚarchive_rootÚfilenameÚ	pyversionr$   r$   r%   Úrun^   sL   


ÿÿÿÿû
ÿzbdist_dumb.runN)Ú__name__Ú
__module__Ú__qualname__Údescriptionr
   Úuser_optionsr   r   ÚlistÚstrÚ__annotations__r.   r&   r2   rL   r$   r$   r$   r%   r      s,   
 ÿýâ%
r   )Ú__doc__r+   Údistutils._logr   Útypingr   Úcorer   Údir_utilr   r   Úerrorsr   Ú	sysconfigr	   Úutilr
   r   r$   r$   r$   r%   Ú<module>   s    