o
    bb:                     @   s   d Z ddlZddl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 G dd deZd	ed
efddZded
efddZdS )zD
Create a dist_info directory
As defined in the wheel specification
    N)cleandoc)Command)log)	packagingc                   @   s.   e Zd ZdZdgZdd Zdd Zdd Zd	S )
	dist_infozcreate a .dist-info directory)z	egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree)c                 C   s
   d | _ d S N)egg_baseself r   {home/ych/rk3568/buildroot/output/rockchip_rk3568_recovery/host/lib/python3.10/site-packages/setuptools/command/dist_info.pyinitialize_options   s   
zdist_info.initialize_optionsc                 C   s   d S r   r   r
   r   r   r   finalize_options   s   zdist_info.finalize_optionsc                 C   s   |  d}| j|_|  |  t| j }t| j }| jp$t	j
}t	j|| d| d}tdt	j| |  d}||j| d S )Negg_info-z
.dist-infozcreating '{}'bdist_wheel)get_finalized_commandr	   r   run_safedistributionget_name_versionget_versionoscurdirpathjoinr   infoformatabspathZegg2distr   )r   r   nameversionbaseZdist_info_dirr   r   r   r   r      s   

zdist_info.runN)__name__
__module____qualname__descriptionuser_optionsr   r   r   r   r   r   r   r      s    r   	componentreturnc                 C   s   t dd| S )zAEscape a component used to form a wheel name according to PEP 491z	[^\w\d.]+_)resub)r)   r   r   r   r   .   s   r   r"   c                 C   sl   |  dd}zttj| ddW S  tjjy5   d| d| d}tt| t	|
d Y S w )z0Convert an arbitrary string to a version string. .r   r+   zInvalid version: zk.
        !!


        ###################
        # Invalid version #
        ###################
        z is not valid according to PEP 440.

        Please make sure specify a valid version for your package.
        Also note that future releases of setuptools may halt the build process
        if an invalid version is given.
        

!!
        )replacestrr   r"   VersionInvalidVersionwarningswarnr   r   strip)r"   vmsgr   r   r   r   3   s   r   )__doc__r   r,   r4   inspectr   distutils.corer   	distutilsr   setuptools.externr   r   r1   r   r   r   r   r   r   <module>   s    