VULN_CHECK_I913V6 (fnddlmZddlmZddlmZddlmZmZddlm Z ddlZ ddl Z ddl Z ddl Z ddlZ ddlZddlZddlZddlZej&dZgdd gd gd ggd d ZdZdZdZdZGddej4Zy))absolute_import)unicode_literals)commands)_P_)miscNdnf)metadatadbcache expire-cachepackagesr r )r r r )r r r r allc#Ktj|D]n\}}}tjj||}|D]C}tjj ||}tjj |Epyw)z:Traverse dirpath recursively and yield relative filenames.N)oswalkpathrelpathjoinnormpath)dirpathrootdirsfilesbasefrs ;/usr/lib/python3.12/site-packages/dnf/cli/commands/clean.py_treer1sgWWW-dEwwtW-A77<<a(D''""4( (.sBB cfd|DS)z5Yield those filenames that match any of the patterns.c3^K|]$}D]}tj||s|&ywNrematch).0rppatternss r z_filter..<s& Au!h"((1a.AhAus - -)rr&s `r_filterr):s Au AAcd}|D]t}tjj||}tj t j jtd|tj||dz }v|S)z(Remove the given filenames from dirpath.rzRemoving file %s) rrrloggerlogr loggingDDEBUGrrunlink_f)rrcountrrs r_cleanr3?sa E ww||GQ' 3;;%%q);'.Ms3Urxx#Us #c3DK|]}|s|jdyw)repoidN)group)r$ms rr'z _cached_repos..Ns7'QQqwwx 's  )r repo CACHE_FILESset)rmatchesr6s @r _cached_reposr?Js2hh"":.G3U3G 7'7 77r*c:eZdZdZdZedZedZdZ y) CleanCommandzSA class containing methods needed by the cli to execute the clean command. )cleanzremove cached datacd|jddtjtdy)Ntype+zMetadata type to clean)nargschoiceshelp) add_argument _CACHE_TYPESkeysr)parsers r set_argparserzCleanCommand.set_argparserYs.F##/#4#4#6 !": ;  =r*c |jjj}tjj |d}tjj |d}tjj|jjjd} |5|5|5td|jjD}tt|}tjt!ddj#|zd|vrit%|}|jj&j(j+||j-dtj/t!d|Dcgc]}tj0j2|!} }t5|t7|| } tj/t9dd| | z dddddddddycc}w#1swYnxYwdddn #1swYnxYwdddn #1swYnxYwn#tj:j<$ro} |jjj>sCt!d | j@z} tj/| tCjDd n| Yd} ~ nd} ~ wwxYw+) NTc3<K|]}t|D]}|ywr )rJ)r$cts rr'z#CleanCommand.run..gsS>aszCleaning data:  r zCache was expiredz%d file removedz%d files removedz*Waiting for process with pid %d to finish.)#rconfcachedirr lockbuild_metadata_lockbuild_download_lockbuild_rpmdb_lock persistdirr=optsrDlistrr-debugrrr?_repo_persistorexpired_to_addupdateremoveinfor;r<r3r)r exceptions LockError exit_on_lockpidtimesleep) selfrUmd_lock download_lock rpmdb_locktypesrexpiredrQr&r2emsgs rrunzCleanCommand.run_s99>>**((..x>44XtD XX..tyy~~/H/H$O  mZS499>>SSE x1ELL#4sxx#F!GH%."/"6 11@@GGP ^4 A&9$:;AFGA 4 4Q 7HG"8WUH-EFEKK#46H% PSX XY.8mWW H.8ZmmmWWW>>++ yy~~22HIQUUSCKK$JJqMG"  #s!H:#H-&H)CH$G> )HH H H-H! H-$ H:-H62H::KA%KKN) __name__ __module__ __qualname____doc__aliasesrsummary staticmethodrMrqr(r*rrArAQs0G$%G== r*rA) __future__rrdnf.clirdnf.i18nrrdnf.yumrr dnf.exceptionsdnf.lock dnf.loggingdnf.repor/rr"rg getLoggerr-rJrr)r3r?CommandrAr(r*rrs*''   5 !8 {#$ .  )B 8*8##*r*