a º&cŒã@sVddlmZddlmZddlmZddlZGdd„dejƒZGdd„dej j ƒZ dS) é)Úabsolute_import)Úunicode_literals)Ú_Ncs eZdZdZ‡fdd„Z‡ZS)Ú RepoClosureÚ repoclosurecs,tt|ƒ ||¡|durdS| t¡dS©N)ÚsuperrÚ__init__Zregister_commandÚRepoClosureCommand)ÚselfÚbaseÚcli©Ú __class__©ú;/usr/lib/python3.9/site-packages/dnf-plugins/repoclosure.pyr !szRepoClosure.__init__)Ú__name__Ú __module__Ú __qualname__Únamer Ú __classcell__rrrrrsrc@s>eZdZdZedƒZdd„Zdd„Zd dd „Ze d d „ƒZ dS) r )rz:Display a list of unresolved dependencies for repositoriescCs`|jj}d|_d|_|jjr\|jj ¡D]2}|j |jjvrR|j |jj vrR|  ¡q(|  ¡q(dS)NT) r ÚdemandsZsack_activationZavailable_reposÚoptsÚrepor ÚreposÚallÚidÚcheckÚdisableÚenable)r rrrrrÚ configure,s zRepoClosureCommand.configurecCs¾d}|jjr| |jj¡}n| ¡}t| ¡ƒD]\}td t|ƒ|j¡ƒtd t ||ƒ¡ƒ|t ||ƒ7}||D]}td |¡ƒqxq0t |ƒdkrºt d |t |ƒ¡ƒ}t j   |¡‚dS)Nrzpackage: {} from {}z unresolved deps ({}):z {}zGRepoclosure ended with unresolved dependencies ({}) across {} packages.)rÚarchesÚ_get_unresolvedÚsortedÚkeysÚprintÚformatÚstrÚreponameÚlenrÚdnfÚ exceptionsÚError)r Z total_missingÚ unresolvedÚpkgZdepÚmsgrrrÚrun7s"  ÿÿzRepoClosureCommand.runNc s<i}tƒ}|jjrŽ|jj ¡jdd�‰|jj ¡jdd�}|jj ¡D]D}ˆ  |jj ¡j|j d�  ¡¡‰|  |jj ¡j|j d�  ¡¡}qFn |jj ¡  ¡‰|jj ¡  ¡}|jj �rF|jj ¡jdd�}g}|jj D]H}tj |¡} | | j|jjdddd�¡} | �r|  | ¡}qØ| |¡qØ|�rBtj tdƒd |¡¡‚|}|jj�r`|j|jjd�|du�rv|j|d�|jjj�rŽˆjdd �ˆ ¡| ¡|D]Z}tƒ||<|jD]B} t| ƒ} |  d ¡�s¶|  d ¡�rÞ�q¶|  | ¡||  | ¡�q¶�q¢t‡fd d „|Dƒƒ‰‡fdd„| !¡Dƒ} dd„|  !¡DƒS)NT)Úempty)r(F)Z with_nevraZ with_providesZwith_filenameszno package matched: %sz, )Úarch)Zlatest_per_archz solvable:zrpmlib(c3s|]}ˆj|d�s|VqdS))ZprovidesN)Úfilter©Ú.0Úx)Ú availablerrÚ –óz5RepoClosureCommand._get_unresolved..cs(i|] \}}|t‡fdd„|Dƒƒ“qS)c3s|]}|ˆvr|VqdSrrr4©Úunresolved_depsrrr8˜r9z@RepoClosureCommand._get_unresolved...)Úset©r5ÚkÚvr:rrÚ ˜sÿz6RepoClosureCommand._get_unresolved..cSsi|]\}}|r||“qSrrr=rrrr@šr9)"r<rZnewestr ZsackÚqueryr3rZ iter_enabledÚunionrZlatestr7Úpkglistr*ZsubjectZSubjectÚ intersectionZget_best_queryÚappendr+r,rÚjoinrZfiltermZconfZbestZapplyZrequiresr'Ú startswithÚaddÚitems)r r2r-ZdepsZto_checkrZ pkglist_qÚerrorsr.ZsubjZpkg_qZreqZreqnameZunresolved_transitionr)r7r;rr"Ksjÿÿ    ÿÿ  ÿ        ÿ  ÿz"RepoClosureCommand._get_unresolvedcCs`|jdgddtdƒd�|jdgdtdƒd�|jd d d td ƒd �|jdgdtdƒdd�dS)Nz--archrEr!zBcheck packages of the given archs, can be specified multiple times)ÚdefaultÚactionÚdestÚhelpz--checkzSpecify repositories to check)rKrLrNz-nz--newestÚ store_truez+Check only the newest packages in the repos)rLrNz--pkgz#Check closure for this package onlyrC)rKrLrNrM)Ú add_argumentr)ÚparserrrrÚ set_argparserœs ÿ ÿ ÿ þz RepoClosureCommand.set_argparser)N) rrrÚaliasesrZsummaryr r0r"Ú staticmethodrRrrrrr (s  Qr ) Z __future__rrZdnfpluginscorerZdnf.clir*ZPluginrr ZCommandr rrrrÚs