<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
gt`                 @   sV   d dl mZ d dl mZ d dlmZ d dlZG dd dejZG dd dej	j
ZdS )	    )absolute_import)unicode_literals)_Nc                   s    e Zd ZdZ fddZ  ZS )RepoClosurerepoclosurec                s,   t t| j|| |d krd S |jt d S )N)superr   __init__Zregister_commandRepoClosureCommand)selfbasecli)	__class__ !/usr/lib/python3.6/repoclosure.pyr   !   s    zRepoClosure.__init__)__name__
__module____qualname__namer   __classcell__r   r   )r   r   r      s   r   c               @   s>   e Zd ZdZedZdd Zdd Zddd	Ze	d
d Z
dS )r	   r   z:Display a list of unresolved dependencies for repositoriesc             C   sd   | j j}d|_d|_| jjr`xB| jjj D ]2}|j	| jjkrT|j	| jj
krT|j  q*|j  q*W d S )NT)r   demandsZsack_activationZavailable_reposoptsrepor   reposallidcheckdisableenable)r
   r   r   r   r   r   	configure,   s    
zRepoClosureCommand.configurec             C   s   | j jr| j| j j}n| j }xRt|j D ]B}tdjt||j td x|| D ]}tdj| qZW q.W t	|dkrt
d}tjj|d S )Nzpackage: {} from {}z  unresolved deps:z    {}r   z/Repoclosure ended with unresolved dependencies.)r   arches_get_unresolvedsortedkeysprintformatstrreponamelenr   dnf
exceptionsError)r
   
unresolvedpkgZdepmsgr   r   r   run7   s    zRepoClosureCommand.runNc                sL  i }t  }| jjr| jjj jdd | jjj jdd}xv| jjj D ]D} j	| jjj j|j
dj  |j	| jjj j|j
dj }qHW n | jjj j  | jjj j }| jjrN| jjj jdd}g }xT| jjD ]H}tjj|}	|j|	j| jjdddd}
|
r|j	|
}q|j| qW |rJtjjtddj| |}| jjrh|j| jjd |d k	r~|j|d | jjjr jdd	  j  |j  xf|D ]^}t  ||< xL|jD ]B}t|}|jd
s|jdrq|j | || j | qW qW t  fdd|D fdd|j! D }dd |j! D S )NT)empty)r&   F)Z
with_nevraZwith_providesZwith_filenameszno package matched: %sz, )arch)Zlatest_per_archz	solvable:zrpmlib(c             3   s   | ]} j |d s|V  qdS ))ZprovidesN)filter).0x)	availabler   r   	<genexpr>   s    z5RepoClosureCommand._get_unresolved.<locals>.<genexpr>c                s(   i | ] \}}t  fd d|D |qS )c             3   s   | ]}| kr|V  qd S )Nr   )r2   r3   )unresolved_depsr   r   r5      s    z@RepoClosureCommand._get_unresolved.<locals>.<dictcomp>.<genexpr>)set)r2   kv)r6   r   r   
<dictcomp>   s   z6RepoClosureCommand._get_unresolved.<locals>.<dictcomp>c             S   s   i | ]\}}|r||qS r   r   )r2   r8   r9   r   r   r   r:      s    )"r7   r   Znewestr   ZsackZqueryr1   r   Ziter_enabledunionr   Zlatestr4   pkglistr(   ZsubjectZSubjectintersectionZget_best_queryappendr)   r*   r   joinr   ZfiltermZconfZbestZapplyZrequiresr%   
startswithadditems)r
   r0   r+   ZdepsZto_checkr   Z	pkglist_qerrorsr,   ZsubjZpkg_qZreqZreqnameZunresolved_transitionr   )r4   r6   r   r    E   s\     &






z"RepoClosureCommand._get_unresolvedc             C   s`   | j dg ddtdd | j dg dtdd | j d	d
dtdd | j dg dtddd d S )Nz--archr>   r   zBcheck packages of the given archs, can be specified multiple times)defaultactiondesthelpz--checkzSpecify repositories to check)rD   rE   rG   z-nz--newest
store_truez+Check only the newest packages in the repos)rE   rG   z--pkgz#Check closure for this package onlyr<   )rD   rE   rG   rF   )add_argumentr   )parserr   r   r   set_argparser   s    


z RepoClosureCommand.set_argparser)r   )N)r   r   r   aliasesr   Zsummaryr   r.   r    staticmethodrK   r   r   r   r   r	   (   s   
Qr	   )Z
__future__r   r   Zdnfpluginscorer   Zdnf.clir(   ZPluginr   r   ZCommandr	   r   r   r   r   <module>   s
   