관리-도구
편집 파일: check.cpython-36.pyc
3 �ft`? � @ 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_typesZappend_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 �argparseZSUPPRESS)�parser� r �/usr/lib/python3.6/check.py� set_argparser$ s$ 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 s� t � }| jjj� j� }| jjjddh��r�d }�x||D �]r}x�t |j�t t |j �t |j � �B D ]�}t|�jd�rtq`t |j|gd��s`t|�jd�r�|d kr�tjj| j�}tjj|�}|j t|�d� tjj|�}| jjj|_|j|dd� |j� }|r�q`td�} |j| j| jjjj|�| jjjj|��� q`W xx|jD ]n} |j| gt| �j � d d �}xJ|D ]B}d} |j| j| jjjj|�| jjjj| �| jjjj|��� �q^W �q8W q6W | jjjddh��rN| jj!|�} |j"� j#| �j$� }xl|j%� D ]`\}}|j&� xL|d d � D ]<}td�j| jjjj|d �| jjjj|��} |j| � �qW �q�W | jjjddh��r�x||D ]t}xl|j'D ]b}|j|gt|�j � d d �}t |��rttd�j| jjjj|d �| jjjj|��} |j| � �qtW �qhW | jjjddh��r\xf|D ]^}xV|j(D ]L}||j|gd�k�rtd�} |j| j| jjjj|�| jjjj|��� �qW �q�W xt)|�D ]} t*| � �qfW |�r�tj+j,djt |����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 �sackZqueryZ installedr r �intersectionZregular_requiresZrequires_preZprereq_ignoreinst�str� startswith�len�filter�dnfZ rpmdb_sack�selectorZSelector�goalZGoalr Zprotect_running_kernelZinstall�runr �add�format�outputZtermZboldZ conflicts�splitZ_get_installonly_queryZ duplicated� differenceZ _name_dict�items�sortZ obsoletesr �sorted�print� exceptions�Error)r Z output_set�qr% ZpkgZrequirer, r- Zsolved�msgZconflictZ conflictedZconflict_pkgZinstallonlyZdupsr# Zpkgs�dupZobsoleter Zprovider r r r. I s� ( $ zCheckCommand.runN)r )�__name__� __module__�__qualname__�__doc__�aliasesr Zsummary�staticmethodr r! r. r r r r r s r )Z __future__r r Zdnf.i18nr Zdnf.clir r Zdnf.exceptionsr+ ZCommandr r r r r �<module> s