OwlCyberSecurity - MANAGER
Edit File: repoclosure.cpython-36.pyc
3 �gt`�������������������@���sV���d�dl�mZ�d�dl�mZ�d�dlmZ�d�dlZG�dd��dej�ZG�dd��dej j �ZdS�) �����)�absolute_import)�unicode_literals)�_Nc�������������������s ���e�Zd�ZdZ��fdd�Z���ZS�)�RepoClosure�repoclosurec����������������s,���t�t|��j||��|d�krd�S�|jt��d�S�)N)�superr����__init__Zregister_command�RepoClosureCommand)�self�base�cli)� __class__���!/usr/lib/python3.6/repoclosure.pyr���!���s����zRepoClosure.__init__)�__name__� __module__�__qualname__�namer���� __classcell__r���r���)r ���r���r������s���r���c���������������@���s>���e�Zd�ZdZed�Zdd��Zdd��Zd dd �Ze d d���Z dS�)r ���r���z:Display a list of unresolved dependencies for repositoriesc�������������C���sd���|�j�j}d|_d|_|�jjr`xB|�jjj��D�]2}|j |�jjkrT|j |�jj krT|j���q*|j���q*W�d�S�)NT) r����demandsZsack_activationZavailable_repos�opts�repor����repos�all�id�check�disable�enable)r ���r���r���r���r���r���� configure,���s���� zRepoClosureCommand.configurec�������������C���s����|�j�jr|�j|�j�j�}n|�j��}xRt|j���D�]B}tdjt|�|j���td��x||�D�]}tdj|���qZW�q.W�t |�dkr�t d�}tjj |��d�S�)Nzpackage: {} 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�pkgZdep�msgr���r���r����run7���s����zRepoClosureCommand.runNc����������������sL��i�}t���}|�jjr�|�jjj��jdd���|�jjj��jdd�}xv|�jjj��D�]D}��j |�jjj��j|j d�j�����|j |�jjj��j|j d�j���}qHW�n |�jjj��j����|�jjj��j��}|�jj �rN|�jjj��jdd�}g�}xT|�jj D�]H}tjj|�} |j| j|�jjdddd��} | �r|j | �}q�|j|��q�W�|�rJtjjtd�dj|����|}|�jj�rh|j|�jjd��|d�k �r~|j|d��|�jjj�r���jdd ����j���|j���xf|D�]^}t���||<�xL|jD�]B}t|�}|jd ��s�|jd��r�q�|j |��||�j |���q�W��q�W�t���fdd �|D�����fdd�|j!��D��} dd��| j!��D��S�)NT)�empty)r&���F)Z with_nevraZ with_providesZwith_filenameszno package matched: %sz, )�arch)Zlatest_per_archz solvable:zrpmlib(c�������������3���s���|�]}��j�|d��s|V��qdS�))ZprovidesN)�filter)�.0�x)� availabler���r���� <genexpr>����s����z5RepoClosureCommand._get_unresolved.<locals>.<genexpr>c����������������s(���i�|�] \}}t���fd�d�|D���|�qS�)c�������������3���s���|�]}|��kr|V��qd�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||�qS�r���r���)r2���r8���r9���r���r���r���r:�������s����)"r7���r���Znewestr���ZsackZqueryr1���r���Ziter_enabled�unionr���Zlatestr4����pkglistr(���ZsubjectZSubject�intersectionZget_best_query�appendr)���r*���r����joinr���ZfiltermZconfZbestZapplyZrequiresr%���� startswith�add�items)r ���r0���r+���ZdepsZto_checkr���Z pkglist_q�errorsr,���ZsubjZpkg_qZreqZreqnameZunresolved_transitionr���)r4���r6���r���r ���E���s\���� & z"RepoClosureCommand._get_unresolvedc�������������C���s`���|�j�dg�ddtd�d��|�j�dg�dtd�d��|�j�d d dtd�d ��|�j�dg�dtd�dd��d�S�)Nz--archr>���r���zBcheck packages of the given archs, can be specified multiple times)�default�action�dest�helpz--checkzSpecify 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���Zsummaryr���r.���r ����staticmethodrK���r���r���r���r���r ���(���s��� Qr ���)Z __future__r���r���Zdnfpluginscorer���Zdnf.clir(���ZPluginr���r���ZCommandr ���r���r���r���r����<module>���s ���