Current File : //lib/python3.9/site-packages/dnf/cli/commands/__pycache__/check.cpython-39.opt-1.pyc |
a
�!c? � @ sV d dl mZ d dl mZ d dlmZ d dlmZ d dlZd dlZ G dd� dej
�ZdS )� )�absolute_import)�unicode_literals)�_)�commandsNc @ s8 e Zd ZdZdZed�Zedd� �Zdd� Z dd � Z
d
S )�CheckCommandzSA class containing methods needed by the cli to execute the check
command.
)�checkz#check for problems in the packagedbc C s� | j ddddtd�d� | j ddddtd �d� | j d
dddtd�d� | j d
dddtd�d� | j ddddtd�d� | j dddddddg gtjd� d S )Nz--all�check_types�append_const�allzshow all problems; default)�dest�action�const�helpz--dependencies�dependencieszshow dependency problemsz--duplicates�
duplicateszshow duplicate problemsz--obsoleted� obsoletedzshow obsoleted packagesz
--provides�provideszshow problems with provides�check_yum_types�*)�nargs�choicesr )�add_argumentr �argparse�SUPPRESS)�parser� r �:/usr/lib/python3.9/site-packages/dnf/cli/commands/check.py�
set_argparser$ s2 �������zCheckCommand.set_argparserc C sx d| j j_| jjr<| jjr0| jj| jj | j_n| jj| j_| jjsPdh| j_nt| jj�| j_| jj j dg7 _ d S )NTr
)
ZcliZdemandsZsack_activation�optsr r �set�base�confZdisable_excludes)�selfr r r � configure; s
�
zCheckCommand.configurec C sj t � }| jj�� �� }| jj�ddh��r�d }|D �]f}t |j�t t |j �t |j
� �B D ]�}t|��d�rnqZt
|j|gd��sZt|��d�r�|d u r�tj�| j�}tj�|�}|j t|�d� tj�|�}| jjj|_|j|dd� |�� }|r�qZtd�} |�| �| jjj�|�| jjj�|��� qZ|jD ]j}
|j|
gt|
�� � d d
�}|D ]B}d} |�| �| jjj�|�| jjj�|
�| jjj�|��� �qR�q.q2| jj�ddh��r4| j�!|�}
|�"� �#|
��$� }|�%� D ]\\}}|�&� |d
d � D ]<}td��| jjj�|d �| jjj�|��} |�| � �q�q�| jj�ddh��r�|D ]p}|j'D ]b}|j|gt|�� � d d
�}t
|��rVtd��| jjj�|d �| jjj�|��} |�| � �qV�qL| jj�ddh��r2|D ]Z}|j(D ]L}||j|gd�v�r�td�} |�| �| jjj�|�| jjj�|��� �q�q�t)|�D ]} t*| � �q:|�rftj+�,d�t
|����d S )Nr
r Zrpmlib)r �(F)ZselectZoptionalz{} has missing requires of {}r )r �namez"{} has installed conflict "{}": {}r � z{} is a duplicate with {}r z{} is obsoleted by {}r z%{} provides {} but it cannot be foundzCheck discovered {} problem(s))-r r �sack�queryZ installedr r �intersectionZregular_requiresZrequires_preZprereq_ignoreinst�str�
startswith�len�filter�dnfZ
rpmdb_sack�selectorZSelector�goalZGoalr! Zprotect_running_kernel�install�runr �add�format�outputZtermZbold� conflicts�splitZ_get_installonly_queryZ
duplicated�
differenceZ
_name_dict�items�sortZ obsoletesr �sorted�print�
exceptions�Error)r"