B M��j��@sHdZddlZddlmZddlTddlmZdd�ZGdd �d e�ZdS) zidistutils.command.bdist Implements the Distutils 'bdist' command (create a built [binary] distribution).�N)�Command)�*)� get_platformcCsTddlm}g}x,tjD]"}|�d|dtj|df�qW||�}|�d�dS)zFPrint list of available formats (arguments to "--format" option). r)� FancyGetoptzformats=N�z'List of available distribution formats:)Zdistutils.fancy_getoptr�bdist�format_commands�append�format_commandZ print_help)r�formats�formatZpretty_printer�r �</opt/alt/python37/lib64/python3.7/distutils/command/bdist.py� show_formats s   rc @s�eZdZdZdddde�fdddd d gZd gZd d defgZdZ ddd�Z dddddddddg Z ddddddd d!d"d#� Z d$d%�Z d&d'�Zd(d)�Zd S)*rz$create a built (binary) distribution)z bdist-base=�bz4temporary directory for creating built distributionsz plat-name=�pz;platform name to embed in generated filenames (default: %s))zformats=Nz/formats for distribution (comma-separated list))z dist-dir=�dz=directory to put final built distributions in [default: dist])z skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]z skip-buildz help-formatsNz$lists available distribution formats)� bdist_rpm�gztar�zip)�posix�nt�rpm�bztar�xztar�ztar�tar�wininst�msi)rzRPM distribution)� bdist_dumbzgzip'ed tar file)r!zbzip2'ed tar file)r!zxz'ed tar file)r!zcompressed tar file)r!ztar file)Z bdist_wininstzWindows executable installer)r!zZIP file)Z bdist_msizMicrosoft Installer) rrrrrrrrr cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)� bdist_base� plat_namer �dist_dir� skip_build�group�owner)�selfr r r�initialize_optionsQszbdist.initialize_optionscCs�|jdkr(|jrt�|_n|�d�j|_|jdkrT|�d�j}tj�|d|j�|_|� d�|j dkr�y|j tj g|_ Wn"t k r�tdtj ��YnX|jdkr�d|_dS)NZbuildzbdist.r z;don't know how to create built distributions on platform %sZdist)r#r%rZget_finalized_commandr"� build_base�os�path�joinZensure_string_listr �default_format�name�KeyErrorZDistutilsPlatformErrorr$)r(r*r r r�finalize_optionsZs$       zbdist.finalize_optionsc Cs�g}xH|jD]>}y|�|j|d�Wq tk rHtd|��Yq Xq Wxztt|j��D]h}||}|�|�}||jkr�|j||_ |dkr�|j |_ |j |_ |||dd�kr�d|_ |� |�q^WdS)Nrzinvalid format '%s'r!r)r r r r0ZDistutilsOptionError�range�lenZreinitialize_command�no_format_optionr r'r&Z keep_tempZ run_command)r(Zcommandsr �iZcmd_nameZsub_cmdr r r�runvs"    z bdist.run)�__name__� __module__� __qualname__Z descriptionrZ user_optionsZboolean_optionsrZ help_optionsr4r.rr r)r1r6r r r rrs<    r) �__doc__r+Zdistutils.corerZdistutils.errorsZdistutils.utilrrrr r r r�<module>s