o ?Og 2@s ddlZddlZddlZddlZddlmZddlmZmZddl m Z GdddZ ddZ ej fd d Zd d ZdddZdS)N convert_path)DistutilsTemplateErrorDistutilsInternalError)logc@s|eZdZ dddZddZejfddZdd Zd d Z d d Z ddZ ddZ ddZ ddZdddZ dddZdS)FileListNcCsd|_g|_dSN)allfilesfiles)selfwarn debug_printr9/opt/alt/python310/lib64/python3.10/distutils/filelist.py__init__s zFileList.__init__cCs ||_dSr)r )r r rrr set_allfiles#s zFileList.set_allfilescCst||_dSr)findallr )r dirrrrr&szFileList.findallcCs" ddlm}|rt|dSdS)Nr)DEBUG)Zdistutils.debugrprint)r msgrrrrr )s   zFileList.debug_printcC|j|dSr)r append)r itemrrrr3zFileList.appendcCrr)r extend)r itemsrrrr6rzFileList.extendcCs<tttjj|j}g|_|D] }|jtjj|qdSr)sortedmapospathsplitr rjoin)r Zsortable_filesZ sort_tuplerrrsort9s z FileList.sortcCs@tt|jdddD]}|j||j|dkr|j|=q dS)Nr)rangelenr )r irrrremove_duplicatesCs zFileList.remove_duplicatescCs|}|d}d}}}|dvr*t|dkrtd|dd|ddD}n?|dvrLt|d kr:td |t|d}d d|ddD}n|d vrct|dkr\td |t|d}ntd|||||fS)Nr)includeexcludeglobal-includeglobal-excludez&'%s' expects ...cSg|]}t|qSrr.0wrrr Wz1FileList._parse_template_line..r$)recursive-includerecursive-excludez,'%s' expects ...cSr/rrr0rrrr3]r4)graftprunez#'%s' expects a single zunknown action '%s')r!r'rr)r lineZwordsactionpatternsr dir_patternrrr_parse_template_lineLs0       zFileList._parse_template_linecCs6||\}}}}|dkr+|dd||D]}|j|dds(td|qdS|dkrM|dd||D]}|j|ddsJtd |q;dS|d kro|d d||D]}|j|d dsltd |q]dS|dkr|dd||D]}|j|d dstd|qdS|dkr|d|d|f|D]}|j||dstd||qdS|dkr|d|d|f|D]}|j||dstd||qdS|dkr|d||jd|dstd|dSdS|dkr|d||jd|dstd|dSdStd|)Nr*zinclude  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 distributionr5zrecursive-include %s %s)prefixz:warning: no files found matching '%s' under directory '%s'r6zrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r8zgraft z+warning: no directories found matching '%s'r9zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r>r r"include_patternrr exclude_patternr)r r:r;r<rr=patternrrrprocess_template_linehs   zFileList.process_template_liner$rcCsn d}t||||}|d|j|jdur||jD]}||r4|d||j|d}q|S)NFz%include_pattern: applying regex r'%s'z adding T)translate_patternr rDr rsearchr r)r rDr@rAis_regex files_found pattern_renamerrrrBs    zFileList.include_patterncCst d}t||||}|d|jtt|jdddD]}||j|r7|d|j||j|=d}q|S)NFz%exclude_pattern: applying regex r'%s'r$r%z removing T)rFr rDr&r'r rG)r rDr@rArHrIrJr(rrrrCszFileList.exclude_pattern)NNr$Nr)__name__ __module__ __qualname__rrrcurdirrr rrr#r)r>rErBrCrrrrrs     L,rcCs( ddtj|ddD}ttjj|S)Ncss.|]\}}}|D] }tj||Vq qdSr)rr r")r1basedirsr filerrr s z#_find_all_simple..T) followlinks)rwalkfilterr isfile)r Zresultsrrr_find_all_simples  rYcCs8 t|}|tjkrtjtjj|d}t||}t|S)N)start) rYrrP functoolspartialr relpathrlist)rr Zmake_relrrrrs   rcCs: t|}tj}tjdkrd}d|}td||}|S)N\z\\\\z\1[^%s]z((?s  i