Wc 2 ddlZddlZddlZddlZddlmZddlmZmZddl m Z GddZ dZ ejfdZd Zd d ZdS) N convert_path)DistutilsTemplateErrorDistutilsInternalError)logcxeZdZ ddZdZej fdZdZdZ dZ dZ d Z d Z d ZddZ ddZdS)FileListNc"d|_g|_dSN)allfilesfiles)selfwarn debug_prints +/usr/lib64/python3.12/distutils/filelist.py__init__zFileList.__init__s  c||_dSr )r )rr s r set_allfileszFileList.set_allfiles#s   rc*t||_dSr )findallr )rdirs rrzFileList.findall&s  rc6 ddlm}|rt|dSdS)Nr)DEBUG)distutils.debugrprint)rmsgrs rrzFileList.debug_print)s4  *))))) 5 #JJJJ 5rc>|jj|dSr )r append)ritems rrzFileList.append3s $rc>|jj|dSr )r extend)ritemss rr"zFileList.extend6s %    rctttjj|j }g|_|D]9}|j j tjj|;dSr )sortedmapospathsplitr rjoin)rsortable_files sort_tuples rsortz FileList.sort9sdBGGMM4:: >? ( 9 9J JJ  bggllJ7 8 8 8 9 9rctt|jdz ddD]9}|j||j|dz ks-|j|=;dS)Nr)rangelenr )ris rremove_duplicateszFileList.remove_duplicatesCs_s4::*Ar2 " "Azz!} 1q5 111JJqMM " "rc|j}|d}dx}x}}|dvr/t|dkrtd|zd|ddD}n|dvrBt|dkrtd |zt|d}d |ddD}nI|d vr5t|dkrtd |zt|d}ntd |z||||fS)Nr)includeexcludeglobal-includeglobal-excludez&'%s' expects ...c*g|]}t|Sr.0ws r z1FileList._parse_template_line..W;;;A Q;rr/)recursive-includerecursive-excludez,'%s' expects ...c*g|]}t|Sr<rr=s rr@z1FileList._parse_template_line..]rAr)graftprunez#'%s' expects a single zunknown action '%s')r)r2rr)rlinewordsactionpatternsr dir_patterns r_parse_template_linezFileList._parse_template_lineLs) q'+++3 : : :5zA~~,>GII;;qr;;HH A A A5zA~~,DvMOOuQx(C;;qr;;HH ) ) )5zQ,;fDFF&uQx0KK()>)GH H#{33rc |j|\}}}}|dkrZ|jddj|z|D]/}|j|drt j d|1dS|dkrZ|jddj|z|D]/}|j |drt j d |1dS|d krZ|jd dj|z|D]/}|j|d rt j d |1dS|dkrZ|jddj|z|D]/}|j |d rt j d|1dS|dkr^|jd|ddj||D]0}|j||rt j d||2dS|dkr^|jd|ddj||D]0}|j ||rt j d||2dS|dkrE|jd|z|jd|st j d|dSdS|dkrE|jd|z|j d|st j d|dSdStd|z)Nr6zinclude  r/)anchorz%warning: no files found matching '%s'r7zexclude z9warning: no previously-included files found matching '%s'r8zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr9zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionrBzrecursive-include )prefixz:warning: no files found matching '%s' under directory '%s'rCzrecursive-exclude zNwarning: no previously-included files matching '%s' found under directory '%s'rFzgraft z+warning: no directories found matching '%s'rGzprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')rMrr*include_patternrrexclude_patternr)rrHrJrKrrLpatterns rprocess_template_linezFileList.process_template_linehs  04/H/H/N,3 Y     Z#((8*<< = =# & &++GA+>>HHD$&&& & & y   Z#((8*<< = =# ? ?++GA+>>HH46=??? ? ? ' ' '   .(1CC D D# D D++GA+>>HH9;BDDD D D ' ' '   .(1CC D D# & &++GA+>>HHD$&&& & & * * *    !cc388H#5#57 8 8# + +++GC+@@HH7$c+++ + + * * *    !cc388H#5#57 8 8# + +++GC+@@HH@$c+++ + + w     X 3 4 4''['AAF$&&&&BAw     X 3 4 4''['AA*,79999BA);fDF Frr/rcP d}t||||}|jd|jz|j|j |jD]H}|j |s|jd|z|j j|d}J|S)NFz%include_pattern: applying regex r'%s'z adding T)translate_patternrrTr rsearchr r)rrTrPrQis_regex files_found pattern_renames rrRzFileList.include_patterns 2 &wI  @#++, - - == LLNNMM # #D  &&  d!233 !!$''" rcn d}t||||}|jd|jztt |j dz ddD]Y}|j |j |s&|jd|j |z|j |=d}[|S)NFz%exclude_pattern: applying regex r'%s'r/r0z removing T)rWrrTr1r2r rX)rrTrPrQrYrZr[r3s rrSzFileList.exclude_patterns  &wI  @#++, - -s4::q("b1 # #A  A//   1 !=>>JJqM" r)NNr/Nr)__name__ __module__ __qualname__rrr'curdirrrrr"r-r4rMrUrRrSr<rrr r s  !!!))%%%%   !!!999"""4448GFGFGFX((((X:;rr c dtj|dD}ttjj|S)Nc3pK|]0\}}}|D]&}tjj||(2dSr )r'r(r*)r>basedirsr files r z#_find_all_simple..sX D$   T4      rT) followlinks)r'walkfilterr(isfile)r(resultss r_find_all_simplernsE!#4!@!@G "''..' **rc t|}|tjkr@tjtj j |}t||}t|S)N)start) rnr'rb functoolspartialr(relpathr&list)rr make_rels rrrsU S !E bii$$RWW__C@@He$ ;rc tj|}tj}tjdkrd}d|z}t j d||}|S)N\z\\\\z\1[^%s]z((?>CE C Oc#h,FG */%%CCCSSQ 6&+eeZE -D-DEJ ::j !!rr^)r'r{rxrqdistutils.utilrdistutils.errorsrr distutilsrr rnrbrr~rWr<rrrs  ''''''KKKKKKKKbbbbbbbP + + +    .""""""""""""r