Your IP : 18.116.27.225


Current Path : /usr/lib/python3.6/site-packages/dnf/cli/commands/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/dnf/cli/commands/__pycache__/remove.cpython-36.pyc

3

�ft`��@s�ddlmZddlmZddlmZddlmZddlmZddl	Z
ddlZddlZddl
Z
ddlZejd�ZGdd	�d	ej�ZdS)
�)�absolute_import)�unicode_literals)�commands)�_)�OptionParserN�dnfc@sbeZdZdZejejejejejejd�Zde	ej
��Zed�Z
edd��Zd	d
�Zdd�Zd
S)�
RemoveCommandzRemove command.)zremove-nz	remove-nazremove-nevrazerase-nzerase-nazerase-nevra�remove�erase�rmz-remove a package or packages from your systemcCsf|j�}|jdddtd�d�|jddtjd�|jddtd	�d�|jd
dtd�tjtd
�d�dS)Nz--duplicates�
store_true�
duplicatedzremove duplicated packages)�action�dest�helpz--duplicated)rrz--oldinstallonlyz*remove installonly packages over the limitZpackages�*zPackage to removeZPACKAGE)�nargsrr�metavar)Zadd_mutually_exclusive_group�add_argumentr�argparseZSUPPRESSrZParseSpecGroupFileCallback)�parserZmgroup�r�/usr/lib/python3.6/remove.py�
set_argparser0s

zRemoveCommand.set_argparsercCs^|jj}d|_d|_d|_|jjr*d|_n0tj	j
rN|jjrNd|_d|_d|_
nd|_
d|_dS)NTF)Zcli�demandsZ	resolvingZ	root_userZsack_activation�optsr
Zavailable_reposr�base�WITH_MODULES�	grp_specsZfresh_metadataZ
allow_erasing)�selfrrrr�	configure?szRemoveCommand.configurecCs\g}|jj|jkr"|j|jjg}|jj|jj7_d}|jj�rD|jjj�}|jj	|j
��}|j�j|�}|s�tj
jtd���x�|j�j�D]�\\}}}t|�dkr�q�|jdd�y|jjt|d��WnHtj
jk
�rd}	td�}
tj|
|jjjjt|d��|	�YnXx"|d	d�D]}|jj|��q&Wq�WdS|jj�r�|jjj�}|jj	|j
��jd�}|jjj�}|dk	�r�|j |j!|j"|j#d
�}
|
�r�|j|
�}|�r�x,|D]}|jj|��q�Wntj
jtd���dS|jj$�r*|�r*x�|jj$D]&}td�}
tj|
|jjjj|���q�Wn�|jj$�r�tjj%�rxtj&j'j(|j�}|j)|jj$�}t|jj$�t|�k�r�d}n|jj$}|�r�xB|D]:}y|jj*|g��r�d}Wntj
jk
�r�YnX�q�Wxx|jjD]l}y|jj)||d
�WnLtj
j+k
�r8}z*dj,|j-|jjjj|��}
tj.|
�WYdd}~XnXd}�q�W|�sXtjtd��dS)NFz)No duplicated packages found for removal.�T)�reverser�z%Installed package %s%s not available.�)�epoch�version�releasez.No old installonly packages found for removal.zNot a valid form: %s)�formsz{}: {}zNo packages marked for removal.���)/rZcommand�nevra_formsZ	pkg_specs�	filenamesr
rZsackZqueryZ_get_installonly_queryZ	installed�
differencer�
exceptions�ErrorrZ_na_dict�items�len�sortZ	reinstall�strZPackagesNotAvailableError�loggerZwarning�outputZtermZboldZpackage_removeZoldinstallonlyZlatestZget_running_kernel�filterr%r&r'rr�module�module_baseZ
ModuleBaser	Zenv_group_removeZMarkingError�format�value�info)rr(�done�qZinstonlyZdups�nameZarchZ	pkgs_listZxmsg�msgZpkgZkernelZrunning_installonlyZgrp_specr7Zskipped_grps�groupZpkg_spec�errr�runPs�
(




 



zRemoveCommand.runN)r	r
r)�__name__�
__module__�__qualname__�__doc__�hawkeyZ	FORM_NAMEZFORM_NAZ
FORM_NEVRAr*�tuple�keys�aliasesrZsummary�staticmethodrr rArrrrr#s
r)Z
__future__rrZdnf.clirZdnf.i18nrZdnf.cli.option_parserrZdnf.baserrrFZdnf.exceptionsZloggingZ	getLoggerr3ZCommandrrrrr�<module>s


?>