grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a j&ã@s`ddlmZddlmZddlmZddlZddlZ ddl Z ddl Z ej j Z Gdd„deƒZdS)é)Úunicode_literals)Ú ConfigError)Ú_Ncs~eZdZdd„Zdd„Zdd„Zdd„Zdd d „Zd d „Zdd„Z dd„Z dd„Z ‡fdd„Z dd„Z dd„Zdd„Z‡ZS)ÚRepoDictc Csl|j}||vrd}t||ƒ‚z|j ¡Wn2ty^}ztd |¡ƒ‚WYd}~n d}~00|||<dS)Nz;Repository %s is listed more than once in the configurationz{0})ÚidrZ_repoZverifyÚ RuntimeErrorÚformat)ÚselfÚrepoZid_ÚmsgÚe©r ú0/usr/lib/python3.9/site-packages/dnf/repodict.pyÚadd#s $z RepoDict.addcCstj | ¡¡S©N)ÚdnfÚutilÚ MultiCallListÚvalues©r r r rÚall/sz RepoDict.allcCstj | ¡¡ Sr)rrÚemptyÚ iter_enabledrr r rÚ _any_enabled3szRepoDict._any_enabledcCsH| ¡D]:}| ||jƒ¡D]$}|jst tdƒ|j¡| ¡qqdS)Nzenabling %s repository)rÚ get_matchingrÚenabledÚloggerÚinforÚenable)r Z sub_name_fnr Úfoundr r rÚ_enable_sub_repos6s  zRepoDict._enable_sub_reposr c  sš‡fdd„}tj |ˆ¡}|D]2}d|vr.substitutez://z file://{}zAdded %s repo from %sz, )rr ZReporÚosÚpathÚabspathÚbaseurlÚitemsÚsetattrrrrrÚjoin) r Zrepoidr$r.Úkwargsr%r r,Úkeyr)r r*rÚ add_new_repo=s  zRepoDict.add_new_repocCsdd„}| |¡dS)z@enable debug repos corresponding to already enabled binary reposcSs&| d¡rd |dd…¡Sd |¡S)Nú-rpmsz {}-debug-rpmséûÿÿÿz {}-debuginfo©Úendswithr©Únamer r rÚ debug_nameesÿz/RepoDict.enable_debug_repos..debug_nameN©r )r r;r r rÚenable_debug_reposaszRepoDict.enable_debug_reposcCsdd„}| |¡dS)zAenable source repos corresponding to already enabled binary reposcSs&| d¡rd |dd…¡Sd |¡S)Nr5z{}-source-rpmsr6z {}-sourcer7r9r r rÚ source_nameosÿz1RepoDict.enable_source_repos..source_nameNr<)r r>r r rÚenable_source_reposkszRepoDict.enable_source_reposcsZtj ˆ¡r,‡‡fdd„ˆDƒ}tj |¡Sˆ ˆd¡}|durLtj g¡Stj |g¡S)Ncs g|]}t |ˆ¡rˆ|‘qSr )Úfnmatch)Ú.0Úk©r3r r rÚ xóz)RepoDict.get_matching..)rrZis_glob_patternrÚget)r r3Úlr r rCrrus    zRepoDict.get_matchingcCsdd„| ¡DƒS)Ncss|]}|jr|VqdSr)r)rAÚrr r rÚ �rEz(RepoDict.iter_enabled..)rrr r rrszRepoDict.iter_enabledcs$dd„ttt|ƒ ¡dd„d�DƒS)zreturn repos sorted by prioritycss|] }|VqdSrr )rAÚitemr r rrI…rEz!RepoDict.items..cSs|dj|djfS)Né)ÚpriorityZcost)Úxr r rÚ†rEz RepoDict.items..)r3)ÚsortedÚsuperrr/r©Ú __class__r rr/ƒsÿzRepoDict.itemscCs| ¡Sr)Úkeysrr r rÚ__iter__ˆszRepoDict.__iter__cCsdd„| ¡DƒS)Ncss|]\}}|VqdSrr ©rArBÚvr r rrIŒrEz RepoDict.keys..©r/rr r rrS‹sz RepoDict.keyscCsdd„| ¡DƒS)Ncss|]\}}|VqdSrr rUr r rrI�rEz"RepoDict.values..rWrr r rrŽszRepoDict.values)r )Ú__name__Ú __module__Ú __qualname__rrrr r4r=r?rrr/rTrSrÚ __classcell__r r rQrr!s  $    r)Z __future__rZdnf.exceptionsrZdnf.i18nrZdnf.utilrZ libdnf.confr#r@r+rrÚdictrr r r rÚs