WcFj ddlZddlZddlZddlmZddlmZmZmZm Z m Z ddlm Z GddZ dS)N)DistutilsOptionError)utildir_util file_util archive_utildep_utillogceZdZ gZdZdZdZdZdZd$dZ d Z d%d Z d Z d&d Z d&dZdZ d&dZdZdZdZdZd%dZd'dZdZdZdZd(dZd)dZ d*dZ d+dZd%d Zd,d!Z d-d"Z d.d#Z!dS)/Commandc ddlm}t||s td|jt ur t d||_|jd|_ |j|_ d|_ d|_ d|_ dS)Nr) Distributionz$dist must be a Distribution instancezCommand is an abstract class)distutils.distr isinstance TypeError __class__r RuntimeError distributioninitialize_options_dry_runverboseforcehelp finalized)selfdistrs &/usr/lib64/python3.12/distutils/cmd.py__init__zCommand.__init__/s 0/////$ --BC C >>W $ $=> >  !! ||   c|dkr-t|d|z}|t|j|S|St|)Ndry_run_)getattrrAttributeError)rattrmyvals r __getattr__zCommand.__getattr___sE 9  D#*-E}t00$77  & &rcN|js|jd|_dSN)rfinalize_optionsrs rensure_finalizedzCommand.ensure_finalizedis%~~~  ! ! # #rc8 td|jzNz,abstract method -- subclass %s must overriderrr,s rrzCommand.initialize_options{% I!^^,- -rc8 td|jzr/r0r,s rr+zCommand.finalize_optionss% I!^^,- -rNctddlm}|d|jz}|j||ztj |dz}|j D]b\}}}|j|}|ddkr|dd}t||}|j||d|ztj ddS) Nr) longopt_xlatezcommand options for '%s':)levelz =z = ) distutils.fancy_getoptr5get_command_nameannouncer INFO user_options translater#)rheaderindentr5optionr"values r dump_optionszCommand.dump_optionss888888 >043H3H3JJF fvoSXX 66$"// * *NVQ%%m4FbzS  D&)E MM&#>> #  * * *  * *rc8 td|jzr/r0r,s rrunz Command.runr1rr*c8 tj||dSNr )rmsgr6s rr;zCommand.announces   srcv ddlm}|r/t|tjj dSdS)Nr)DEBUG)distutils.debugrJprintsysstdoutflush)rrHrJs r debug_printzCommand.debug_printsI  *))))) 5 #JJ JJ       5rc t||}|t||||St|tst d|d|d|d|S)N'z ' must be a z (got `z`))r#setattrrstrr)rrAwhatdefaultvals r_ensure_stringlikezCommand._ensure_stringlikesadF# ; D&' * *NC%%&&*0&&$$$(=> > rc0 |j|d|dS)Nstring)rX)rrArVs r ensure_stringzCommand.ensure_strings$  '::::rc" t||}|dSt|tr't||t j d|dSt|t rtd|D}nd}|std|d|ddS)Nz,\s*|\s+c3>K|]}t|tdSrG)rrT).0vs r z-Command.ensure_string_list..s)99As+++++99rFrRz!' must be a list of strings (got )) r#rrTrSresplitlistallr)rrArWoks rensure_string_listzCommand.ensure_string_lists dF# ; F S ! ! D&"((;"< = = = =#t$$99S9992**&''2rcr|j|||}| ||std|z||fzdSdS)Nzerror in '%s' option: )rXr)rrAtesterrU error_fmtrVrWs r_ensure_tested_stringzCommand._ensure_tested_stringsQ%%fdG< ?66#;;&(@9(L*0#(78 8$/;??rcd |j|tjjdddS)Nfilenamez$'%s' does not exist or is not a file)rkospathisfilerrAs rensure_filenamezCommand.ensure_filenames8C ""6277>>#-#I K K K Krcb|j|tjjdddS)Nzdirectory namez)'%s' does not exist or is not a directory)rkrnroisdirrqs rensure_dirnamezCommand.ensure_dirnames5 ""6277==#3#N P P P Prcbt|dr |jS|jjS)N command_name)hasattrrwr__name__r,s rr:zCommand.get_command_name s+ 4 ( ($$ $>>** *rc  |jj|}|j|D]/\}}t||t ||t||1dSrG)rget_command_objr-r#rS)rsrc_cmd option_pairs src_cmd_obj src_option dst_options rset_undefined_optionszCommand.set_undefined_optionssw ''77@ $$&&(4 L L $ZtZ(0j'+z*JKKK L Lrcd |jj||}|j|SrG)rr{r-)rcommandcreatecmd_objs rget_finalized_commandzCommand.get_finalized_command$s5 ##33GVD  ""rrc<|jj||SrG)rreinitialize_command)rrreinit_subcommandss rrzCommand.reinitialize_command0s"  55g6HJ Jrc@ |jj|dSrG)r run_command)rrs rrzCommand.run_command4s&  %%g....rcn g}|jD]#\}}| ||s|j|%|SrG) sub_commandsappend)rcommandscmd_namemethods rget_sub_commandszCommand.get_sub_commands;sO "&"3"3 * * Xv~)))rcVtjd|j|dS)Nzwarning: %s: %s )r warnr:)rrHs rrz Command.warnKs% $d&;&;&=sCCCCrcPtj||||jdSNr!)rexecuter!)rfuncargsrHr6s rrzCommand.executeNs$ T4dll;;;;;rcNtj|||jdSr)rmkpathr!)rnamemodes rrzCommand.mkpathQs"dDLL99999rc j tj|||||j ||jSr)r copy_filerr!)rinfileoutfile preserve_modepreserve_timeslinkr6s rrzCommand.copy_fileTs< L""67M#1tzz>4+/<<99 9rc j tj||||||j |jSr)r copy_treerr!)rrrrrpreserve_symlinksr6s rrzCommand.copy_tree]s? !!&'="02C&*jj.$,,HH HrcL tj|||jSr)r move_filer!)rsrcdstr6s rrzCommand.move_filefs!2""3T\\BBBrc@ ddlm}||||jdS)Nr)spawnr)distutils.spawnrr!)rcmd search_pathr6rs rrz Command.spawnjs5@)))))) c; 55555rc Rtj|||||j||S)N)r!ownergroup)r make_archiver!)r base_nameformatroot_dirbase_dirrrs rrzCommand.make_archiveos1((FHh15/4ECC Crcj |d|z}t|tr|f}n't|ttfs t d|d|ddj |}|j stj||r|j||||dStj|dS)Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringsz generating z from z, ) rrTrdtuplerjoinrr newer_grouprr debug)rinfilesrrrexec_msgskip_msgr6s r make_filezCommand.make_fileus   7'AH gs # #jGGGdE]33MO O   29''499W;M;MNH :::--gw?? LLtXu 5 5 5 5 IIh    r)Nr3)r*rG)rr))r)r*r*Nr*)r*r*rr*)r*r*)NNNN)NNr*)"ry __module__ __qualname__rrr'r-rr+rCrEr;rPrXr[rgrkrrrur:rrrrrrrrrrrrrrrrr r sr :L ---`'''$ - - - - - - * * * * - - - .;;;; ''','+8888KKK PPP+++ LLL*JJJJ///    DDD<<<<::::JK#$9999JK./HHHHCCCC6666 GK'+CCCC78      rr ) rMrnrbdistutils.errorsr distutilsrrrrrr r rrrrs 111111GGGGGGGGGGGGGGG G G G G G G G G r