Wc 2cs ddlZddlZddlZddlZddlmZddlmZmZddl m Z GddZ dZ ejfdZd Zd d ZdS) N convert_path)DistutilsTemplateErrorDistutilsInternalError)logcsxeZdZ ddZdZej fdZdZdZ dZ dZ d Z d Z d ZddZ ddZdS)FileListNcs"d|_g|_dSN)allfilesfiles)selfwarn debug_print +/usr/lib64/python3.12/distutils/filelist.py__init__zFileList.__init__s  cs||_dSr)r)r r r set_allfileszFileList.set_allfiles#s   rcs*t||_dSr)findallr)r dirrrrzFileList.findall&s  rcs6 ddlm}|rt|dSdS)Nr)DEBUG)Zdistutils.debugrZprint)r Zmsgrr rr zFileList.debug_print)s4  *))))) 5 #JJJJ 5rc>|jj|dSr)r append)r ZitemrrrzFileList.append3s $rcrr)r extend)r ZitemsrrrzFileList.extend6s %    rcstttjj|j }g|_|D]9}|j j tjj|;dSr)Zsortedmapospathsplitr rjoin)r Zsortable_filesZ sort_tupler rsortz FileList.sort9sdBGGMM4:: >? ( 9 9J JJ  bggllJ7 8 8 8 9 9rcstt|jdz ddD]9}|j||j|dz ks-|j|=;dS)Nr)rangelenr )r irrremove_duplicateszFileList.remove_duplicatesCs_s4::*Ar2 " "Azz!} 1q5 111JJqMM " "rcs|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-excludeiz&'%s' expects ...c*g|]}t|Sr.0Zwrr 1FileList._parse_template_line..W;;;A Q;rr)recursive-includerecursive-excludeiz,'%s' expects ...cr)r*rr+rrr-r.]r/r)graftprunez#'%s' expects a single zunknown action '%s')rr"rr)r lineZwordsactionpatternsr dir_pattern 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#{33rcs |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)Nr%zinclude z r)anchorz%warning: no files found matching '%s'r&zexclude z9warning: no previously-included files found matching '%s'r'zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr(zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr0zrecursive-include )prefixz:warning: no files found matching '%s' under directory '%s'r1zrecursive-exclude zNwarning: no previously-included files matching '%s' found under directory '%s'r2zgraft z+warning: no directories found matching '%s'r3zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r9r rinclude_patternrr exclude_patternr)r r4r5r6rr7patternr8rprocess_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 FrrrcsP 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_patternr r>rrsearchr r)r r>r:r;is_regex files_found pattern_reZname rr<zFileList.include_patterns 2 &wI  @#++, - - == LLNNMM # #D  &&  d!233 !!$''" rcsn d}t||||}|jd|jztt |j dz ddD]Y}|j |j |s&|jd|j |z|j |=d}[|S)NFz%exclude_pattern: applying regex r'%s'rr z removing T)r@r r>r!r"r rA)r r>r:r;rBrCrDr#rErr=zFileList.exclude_patterns  &wI  @#++, - -s4::q("b1 # #A  A//   1 !=>>JJqM" r)NNrNr)Z__name__Z __module__Z __qualname__rrrcurdirrr rrrr$r9r?r<r=r*rrrrs  !!!))%%%%   !!!999"""4448GFGFGFX((((X:;rrcs dtj|dD}ttjj|S)Nc3spK|]0\}}}|D]&}tjj||(2dSr)rrr)r,ZbaseZdirsr Zfiles rz z#_find_all_simple..sX D$   T4      rT)Z followlinks)rZwalkZfilterrZisfile)rZresultsrr_find_all_simplerHsE!#4!@!@G "''..' **rcs t|}|tjkr@tjtj j |}t||}t|S)N)start) rHrrG functoolsZpartialrZrelpathrZlist)rr Zmake_relr rrrsU S !E bii$$RWW__C@@He$ ;rcs tj|}tj}tjdkrd}d|z}t j d||}|S)N\z\\\\z\1[^%s]z((?rDrMZescapeds r glob_to_rerOs[ ""7+J &&C vv~~3G-w CJ rrcsR |r,t|trtj|S|St dj d\}}}|rt |}nd}|t |}|t |t |t |z }tj} tjdkrd} |t |t |t |z }|d|| d||}n|r|d|t |d}tj|S)N_ZrKz\\z\Az.*) Z isinstanceZstrrNZcompilerOZ partitionr"rrM) r>r:r;rBrIrPZendrDZ prefix_rerMs rr@r@%s x gs # #::g& &NsO--c2ME1cw(   v& c%j#i.3s8*CD ff 66T>>CE C Oc#h,FG */%%CCCSSQ 6&+eeZE -D-DEJ ::j !!rrF)rrNrLrJZdistutils.utilrZdistutils.errorsrrZ distutilsrrrHrGrrOr@r*rrrQs  ''''''KKKKKKKKbbbbbbbP + + +    .""""""""""""r