ok

Mini Shell

Direktori : /lib/python3.6/site-packages/dnf/cli/commands/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/dnf/cli/commands/__pycache__/mark.cpython-36.pyc

3

�ft`�
�@spddlmZddlmZddlZddlmZddlmZddl	Z	ddl
Z
ddlZejd�Z
Gdd�dej�ZdS)	�)�print_function)�unicode_literalsN)�_)�commands�dnfc@sLeZdZdZed�Zedd��Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)�MarkCommand�markz7mark or unmark installed packages as installed by user.cCs6|jdddddgtd�d�|jdd	d
td�d�dS)
Nr�Zinstall�remove�groupzhinstall: mark as installed by user
remove: unmark as installed by user
group: mark as installed by group)�nargs�choices�help�package�+ZPACKAGEzPackage specification)r�metavarr)�add_argumentr)�parser�r�/usr/lib/python3.6/mark.py�
set_argparser)s
zMarkCommand.set_argparsercCs,|jjj|tjj�tjtd�t	|��dS)Nz%s marked as user installed.)
�base�history�
set_reason�libdnf�transactionZTransactionItemReason_USER�logger�infor�str)�self�pkgrrr�
_mark_install2szMarkCommand._mark_installcCs,|jjj|tjj�tjtd�t	|��dS)Nz%s unmarked as user installed.)
rrrrrZ TransactionItemReason_DEPENDENCYrrrr)rr rrr�_mark_remove6szMarkCommand._mark_removecCs,|jjj|tjj�tjtd�t	|��dS)Nz%s marked as group installed.)
rrrrrZTransactionItemReason_GROUPrrrr)rr rrr�_mark_group:szMarkCommand._mark_groupcCs$|jj}d|_d|_d|_d|_dS)NTF)�cli�demandsZsack_activationZ	root_userZavailable_reposZ	resolving)rr%rrr�	configure>s
zMarkCommand.configurec
Cs|jjd}|jj}tjt|d|��}g}xR|D]J}tjj|�}|j	|j
j�}x|D]}||�qVWt|�dkr2|j
|�q2W|r�tjtd��x|D]}tjtd�|�q�Wtjj�|j
jj�}|dkr�|jj�}	n|j}	|j
jj|	gg�|j
jj|	�dS)NrZ_mark_zError:zPackage %s is not installed.)Zoptsrr�	functools�partial�getattrrZsubjectZSubjectZget_best_queryrZsack�len�appendr�errorrr$ZCliErrorrZlastZ_rpmdb_versionZend_rpmdb_versionZbeg�end)
r�cmdZpkgsZ	mark_funcZnotfoundr Zsubj�q�oldZ
rpmdb_versionrrr�runEs,


zMarkCommand.runN)r)
�__name__�
__module__�__qualname__�aliasesrZsummary�staticmethodrr!r"r#r&r1rrrrr$s	r)Z
__future__rrZlibdnf.transactionrZdnf.i18nrZdnf.clirrr'ZloggingZ	getLoggerrZCommandrrrrr�<module>s


Zerion Mini Shell 1.0