mʙ6qnddlmZddlmZddlmZddlmZddlZddl Z ddl m Z Gdde Z dS) ) annotations) convert_path)log)DistutilsOptionErrorN)Commandc@eZdZUdZdZgdZgZded<dZdZ dZ d S) rotatezDelete older distributionsz2delete older distributions, keeping N newest files))zmatch=mzpatterns to match (required))z dist-dir=dz%directory where the distributions are)zkeep=kz(number of matching distributions to keepz list[str]boolean_optionsc0d|_d|_d|_dS)N)matchdist_dirkeep)selfs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/setuptools/command/rotate.pyinitialize_optionszrotate.initialize_optionss   c|jtd|jtd t|j|_n"#t$r}td|d}~wwxYwt |jt r)d|jdD|_|dddS)NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercPg|]#}t|$S)rstrip).0ps r z+rotate.finalize_options..*s(QQQa,qwwyy11QQQr,bdist)rr) rrrint ValueError isinstancestrsplitset_undefined_options)res rfinalize_optionszrotate.finalize_optionss : &*  9 &'MNN N KDIDII K K K&'BCC J K dj# & & RQQ4:;K;KC;P;PQQQDJ ""7,DEEEEEsA A'A""A'c|dddlm}|jD]"}|jdz|z}|t j|j|}d|D}| | tj dt||||jd}|D]i\}}tj d||jsHt j|rt#j|Ut j|j$dS)Negg_infor)glob*cPg|]#}tj||f$Sr)ospathgetmtime)rfs rrzrotate.run..4s-===!bg&&q))1-===rz%d file(s) matching %sz Deleting %s) run_commandr)r distributionget_namer,r-joinrsortreverserinfolenrdry_runisdirshutilrmtreeunlink)rr)patternfilestr/s rrunz rotate.run-sE $$$z % %G'0022S87BGDdmW==>>E==u===E JJLLL MMOOO H-s5zz7 C C C$)++&E % %1***|%w}}Q''% a(((( !  % % %rN) __name__ __module__ __qualname____doc__ description user_optionsr __annotations__rr&r@rrrr r su$$FKL "$O#### FFF %%%%%rr ) __future__rdistutils.utilr distutilsrdistutils.errorsrr,r: setuptoolsrr rrrrMs""""""''''''111111 4%4%4%4%4%W4%4%4%4%4%r