3 ft`?@sVddlmZddlmZddlmZddlmZddlZddlZ Gdddej Z dS))absolute_import)unicode_literals)_)commandsNc@s8eZdZdZd ZedZeddZddZ dd Z d S) CheckCommandzSA class containing methods needed by the cli to execute the check command. checkz#check for problems in the packagedbc Cs|jddddtdd|jddddtd d|jd ddd td d|jd dddtdd|jddddtdd|jddddd ddggtjddS)Nz--all check_typesZ append_constallzshow all problems; default)destactionconsthelpz--dependencies dependencieszshow dependency problemsz --duplicates duplicateszshow duplicate problemsz --obsoleted obsoletedzshow obsoleted packagesz --providesprovideszshow problems with providescheck_yum_types*)nargschoicesr ) add_argumentrargparseZSUPPRESS)parserr/usr/lib/python3.6/check.py set_argparser$s$     zCheckCommand.set_argparsercCsxd|jj_|jjr<|jjr0|jj|jj|j_n |jj|j_|jjsPdh|j_nt|jj|j_|jjj dg7_ dS)NTr ) ZcliZdemandsZsack_activationoptsrrsetbaseconfZdisable_excludes)selfrrr configure;s   zCheckCommand.configurec Cst}|jjjj}|jjjddhrd}x||D]r}xt|jtt|j t|j BD]}t |j drtq`t |j|gds`t |j dr|dkrtjj|j}tjj|}|jt |dtjj|}|jjj|_|j|dd|j}|rq`td} |j| j|jjjj||jjjj|q`Wxx|jD]n} |j| gt | j d d } xJ| D]B} d } |j| j|jjjj||jjjj| |jjjj| q^Wq8Wq6W|jjjdd hrN|jj!|} |j"j#| j$}xl|j%D]`\}}|j&xL|d dD]<}tdj|jjjj|d |jjjj|} |j| qWqW|jjjddhrx||D]t}xl|j'D]b}|j|gt |j d d }t |rttdj|jjjj|d |jjjj|} |j| qtWqhW|jjjddhr\xf|D]^}xV|j(D]L}||j|gdkrtd} |j| j|jjjj||jjjj|qWqWxt)|D]} t*| qfW|rtj+j,djt |dS)Nr rZrpmlib)r(F)ZselectZoptionalz{} has missing requires of {}r)rnamez"{} has installed conflict "{}": {}rz{} is a duplicate with {}rz{} is obsoleted by {}rz%{} provides {} but it cannot be foundzCheck discovered {} problem(s))-rrsackZqueryZ installedrr intersectionZregular_requiresZ requires_preZprereq_ignoreinststr startswithlenfilterdnfZ rpmdb_sackselectorZSelectorgoalZGoalrZprotect_running_kernelZinstallrunraddformatoutputZtermZboldZ conflictssplitZ_get_installonly_queryZ duplicated differenceZ _name_dictitemssortZ obsoletesrsortedprint exceptionsError)r Z output_setqr%ZpkgZrequirer,r-ZsolvedmsgZconflictZ conflictedZ conflict_pkgZ installonlyZdupsr#ZpkgsdupZobsoleterZproviderrrr.Is(     $       zCheckCommand.runN)r) __name__ __module__ __qualname____doc__aliasesrZsummary staticmethodrr!r.rrrrrs  r) Z __future__rrZdnf.i18nrZdnf.clirrZdnf.exceptionsr+ZCommandrrrrrs