fZ ddlZddlmZddlmZddddZdd Z dd Z dd Zd Z dS)N)DistutilsFileError)logcopyingz hard linkingzsymbolically linking)Nhardsym@c d}d} t|d}n,#t$r}td|d|jd}~wwxYwtj|rB t j|n,#t$r}td|d|jd}~wwxYw t|d}n,#t$r}td|d|jd}~wwxYw ||}n,#t$r}td|d|jd}~wwxYw|snD | |n,#t$r}td |d|jd}~wwxYw |r| |r| dSdS#|r| |r| wwxYw) Nrbzcould not open '': zcould not delete 'wbzcould not create 'Tzcould not read from 'zcould not write to ') openOSErrorrstrerrorospathexistsunlinkreadwriteclose)srcdst buffer_sizefsrcfdstebufs :/opt/alt/python311/lib64/python3.11/distutils/file_util.py_copy_file_contentsrs D D& TT??DD T T T$$###qzz%RSS S T 7>>#   G G # G G G((58SS!**EGGG G CT??DD C C C$$14ajjACC C C I Jii ,, J J J((8;QZZHJJJ J  I 3 I I I((7:ssAJJGIII I I   JJLLL   JJLLLLL     JJLLL   JJLLLL sF A=A"F %A:9F : B#BB##F 'B87F 8 C!CC!!F &C<;F < D%D  D%%F ,EF  E+ E&&E++F /Gc ddlm}ddlm} m} m} m} tj |std|ztj |r@|} tj |tj |}ntj|} |r+|||s|dkrtjd||dfS t"|}n #t$$rt'd|zwxYw|dkrotj |tj |krtjd||| ntjd||||r|dfS|d krjtj|r tj||s* tj|||dfS#t0$rYncwxYwn^|d krXtj|r tj||stj|||dfSt5|||s|r_tj|}|r#tj||| || f|r$tj|| || |dfS) Nr)newer)ST_ATIMEST_MTIMEST_MODES_IMODEz4can't copy '%s': doesn't exist or not a regular filer z"not copying %s (output up-to-date)z&invalid value '%s' for 'link' argumentz %s %s -> %srr)distutils.dep_utilr"statr#r$r%r&rrisfilerisdirjoinbasenamedirnamerdebug _copy_actionKeyError ValueErrorinforsamefilelinkrsymlinkrutimechmod)rr preserve_modepreserve_timesupdater4verbosedry_runr"r#r$r%r&diractionsts r copy_filer@Cs!>)(((((999999999999 7>>#  L DsJLL L w}}S#gll3 0 0 5 566gooc"" eeCoo a<< I:C @ @ @QxJd# JJJADHIIIJ!|| 7  C BG$4$4S$9$9 9 9 H]FC 5 5 5 5 H]FC 5 5 5Qx s## (8(8c(B(B  S!!!Qx        s## (8(8c(B(B  JsC 8OS!!!00 WS\\  8 HS2h<H6 7 7 7  0 HS''"W+.. / / / 8Os1 C??D G99 HHc t ddlm}m}m}m}m}ddl} |dkrtjd|||r|S||std|z||r*tj |||}n!||rtd|d|d|||std|d|d d } tj ||nG#t$r:} | j\} } | | jkrd } ntd |d |d| Yd} ~ nd} ~ wwxYw| rt#||| tj|n]#t$rP} | j\} } tj|n#t$rYnwxYwtd |d |d|d| d} ~ wwxYw|S)Nr)rr)r*r,r-r zmoving %s -> %sz#can't move '%s': not a regular filez can't move 'z': destination 'z' already existsz' not a valid pathFTzcouldn't move 'z' to 'r )r;z' by copy/delete: delete 'z ' failed: )os.pathrr)r*r,r-errnorr2rrrr+renamerargsEXDEVr@r)rrr;r<rr)r*r,r-rCcopy_itrnummsgs r move_filerJsA@@@@@@@@@@@@@LLL!|| "C--- 6#;;N !F!LMMM uSzzgll3 ..   ssCCC  5    ssCCC GF #s FFFV c %+  GG$$69cc333DFF F GGGGF *#sG,,,, * IcNNNN * * *JS#  #    $$SS###sssCC)** * * JsTC** D.40D))D.E F5% F00FF0 FF0FF00F5c t|d} |D]}||dz |dS#|wxYw)Nw )r rr)filenamecontentsflines r write_filerRso XsA ! !D GGD4K  !   s AA)r)r r rNr r)r r) rdistutils.errorsr distutilsrr/rr@rJrRrrWs  //////#'/22 1111fCD,-____H<<<<~     rV