a ´iº ã @ sH d Z ddlZddlmZ ddlT ddlmZ dd„ ZG dd „ d eƒZdS ) zidistutils.command.bdist Implements the Distutils 'bdist' command (create a built [binary] distribution).é N)ÚCommand)Ú*)Úget_platformc C sP ddl m} g }tjD ]"}| d| dtj| d f¡ q| |ƒ}| d¡ dS )zFPrint list of available formats (arguments to "--format" option). r )ÚFancyGetoptúformats=Né z'List of available distribution formats:)Zdistutils.fancy_getoptr ÚbdistÚformat_commandsÚappendÚformat_commandÚ print_help)r ÚformatsÚformatZpretty_printer© r ú//usr/lib64/python3.9/distutils/command/bdist.pyÚshow_formats s ÿr c @ sˆ e Zd ZdZddddeƒ fdddd d gZdgZdd defgZdZ dddœZ g d¢Zddddddddddœ Zdd„ Z dd „ Zd!d"„ Zd S )#r z$create a built (binary) distribution)zbdist-base=Úbz4temporary directory for creating built distributionsz plat-name=Úpz;platform name to embed in generated filenames (default: %s))r Nz/formats for distribution (comma-separated list))z dist-dir=Údz=directory to put final built distributions in [default: dist])ú 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]r zhelp-formatsNz$lists available distribution formats)Ú bdist_rpmÚgztarÚzip)ÚposixÚnt) Zrpmr ÚbztarÚxztarZztarÚtarZwininstr Zmsi)r zRPM 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 Installerc C s. d | _ d | _d | _d | _d| _d | _d | _d S )Nr )Ú bdist_baseÚ plat_namer Údist_dirÚ skip_buildÚgroupÚowner)Úselfr r r Úinitialize_optionsQ s zbdist.initialize_optionsc C s² | j d u r(| jrtƒ | _ n| d¡j | _ | jd u rT| d¡j}tj |d| j ¡| _| d¡ | j d u ržz| jtj g| _ W n t yœ tdtj ƒ‚Y n0 | jd u r®d| _d S )NZbuildzbdist.r z;don't know how to create built distributions on platform %sÚdist)r" r$ r Zget_finalized_commandr! Ú build_baseÚosÚpathÚjoinZensure_string_listr Údefault_formatÚnameÚKeyErrorZDistutilsPlatformErrorr# )r' r* r r r Úfinalize_optionsZ s* ÿ ÿÿ zbdist.finalize_optionsc C sÄ g }| j D ]<}z| | j| d ¡ W q tyD td| ƒ‚Y q 0 q tt| j ƒƒD ]h}|| }| |¡}|| jvr‚| j | |_ |dkrš| j |_ | j|_|||d d … v r´d|_| |¡ qVd S )Nr zinvalid format '%s'r r )r r r r0 ZDistutilsOptionErrorÚrangeÚlenZreinitialize_commandÚno_format_optionr r&