ðÕYfºã@sbdZddlZddlmZddlTddlmZdd„ZGdd „d eƒZdS) zidistutils.command.bdist Implements the Distutils 'bdist' command (create a built [binary] distribution).éN)ÚCommand)Ú*)Ú get_platformcCslddlm}g}x6tjD]+}|jd|dtj|dfƒq W||ƒ}|jdƒ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 údd?dd@d dAd!dBd"dCddDd#dEi Z d0d1„Z d2d3„Zd4d5„Zd S)Frz$create a built (binary) distributionú bdist-base=Úbú4temporary directory for creating built distributionsz plat-name=Úpz;platform name to embed in generated filenames (default: %s)úformats=Nú/formats for distribution (comma-separated list)ú dist-dir=Údú=directory to put final built distributions in [default: dist]ú skip-buildú2skip rebuilding everything (for testing/debugging)úowner=Úuú@Owner name used when creating a tar file [default: current user]úgroup=ÚgúAGroup name used when creating a tar file [default: current group]z help-formatsz$lists available distribution formatsÚ bdist_rpmÚposixZgztarÚntÚzipZrpmZbztarZxztarZztarZtarZwininstZmsiúRPM distributionÚ bdist_dumbúgzip'ed tar fileúbzip2'ed tar fileúxz'ed tar fileúcompressed tar fileútar fileÚ bdist_wininstúWindows executable installerúZIP fileÚ bdist_msiúMicrosoft InstallercCsCd|_d|_d|_d|_d|_d|_d|_dS)Nr)Ú bdist_baseÚ plat_namer Údist_dirÚ skip_buildÚgroupÚowner)Úselfr r rÚinitialize_optionsQs      zbdist.initialize_optionsc Csö|jdkr<|jr'tƒ|_n|jdƒj|_|jdkr||jdƒj}tjj|d|jƒ|_|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)r2r4rZget_finalized_commandr1Ú build_baseÚosÚpathÚjoinZensure_string_listr Údefault_formatÚnameÚKeyErrorZDistutilsPlatformErrorr3)r7r9r r rÚfinalize_optionsZs$    zbdist.finalize_optionsc Cs g}xR|jD]G}y|j|j|dƒWqtk rVtd|ƒ‚YqXqWx©tt|jƒƒD]’}||}|j|ƒ}||jkr¯|j||_ |dkrÓ|j |_ |j |_ |||dd…kröd|_ |j |ƒqqWdS)Nrzinvalid format '%s'r&r)r r r r?ZDistutilsOptionErrorÚrangeÚlenZreinitialize_commandÚno_format_optionr r6r5Z keep_tempZ run_command)r7Zcommandsr ÚiZcmd_nameZsub_cmdr r rÚrunvs"      z bdist.run)rrr)rNr)rrr)rNr)rrr)rrr )r!)r!r%)r&r')r&r()r&r))r&r*)r&r+)r,r-)r&r.)r/r0)Ú__name__Ú __module__Ú __qualname__Z descriptionrZ user_optionsZboolean_optionsrZ help_optionsrCr=rr r8r@rEr r r rrsJ       r) Ú__doc__r:Zdistutils.corerZdistutils.errorsZdistutils.utilrrrr r r rÚs