Your IP : 3.148.105.152


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__/reinstall.cpython-36.opt-1.pyc

3

�ft`]�@slddlmZddlmZddlmZddlmZddlmZddl	Z
ddlZejd�Z
Gdd	�d	ej�ZdS)
�)�absolute_import)�unicode_literals)�commands)�OptionParser)�_N�dnfc@s8eZdZdZdZed�Zedd��Zdd�Z	d	d
�Z
dS)
�ReinstallCommandzSA class containing methods needed by the cli to execute the reinstall command.
    �	reinstall�reizreinstall a packagecCs"|jddtd�tjtd�d�dS)N�packages�+zPackage to reinstallZPACKAGE)�nargs�help�action�metavar)�add_argumentrrZParseSpecGroupFileCallback)�parser�r�/usr/lib/python3.6/reinstall.py�
set_argparser(szReinstallCommand.set_argparsercCsH|jj}d|_d|_d|_d|_tj|j|j�|j	j
sDtj|j�dS)aVerify that conditions are met so that this command can
        run.  These include that the program is being run by the root
        user, that there are enabled repositories with gpg keys, and
        that this command is called with appropriate arguments.
        TN)Zcli�demandsZsack_activationZavailable_reposZ	resolvingZ	root_userrZ_checkGPGKey�base�opts�	filenamesZ_checkEnabledRepo)�selfrrrr�	configure.szReinstallCommand.configurecCs�d}xp|jj|jjd|jjjd�D]P}y|jj|�Wn6tjj	k
rlt
jtd�|jjj
j|j��Yq"Xd}q"W�xD|jjdd�|jjD�D�]$}y|jj|�W�ntjjk
�r}zPx,|jD]"}t
jtd�|jj
j|j��Pq�Wt
jtd�|jjj
j|��WYdd}~Xq�tjjk
�r�}z^xV|jD]L}d}|jjj|�}|�rdtd	�|}td
�}t
j||jjj
j|�|��q<WWYdd}~Xq�tjj	k
�r�Yq�Xd}q�W|�s�tjjtd���dS)NF)�strict�progresszNo match for argument: %sTcSsg|]}d|�qS)�@r)�.0�xrrr�
<listcomp>Lsz(ReinstallCommand.run.<locals>.<listcomp>z(Package %s available, but not installed.�z
 (from %s)z%Installed package %s%s not available.z!No packages marked for reinstall.)rZadd_remote_rpmsrr�outputrZpackage_reinstallr�
exceptionsZMarkingError�logger�inforZtermZbold�locationZ	pkg_specsZ	grp_specsr	ZPackagesNotInstalledErrorr�nameZPackagesNotAvailableError�historyZrepo�Error)r�doneZpkgZpkg_spec�errZxmsgZpkgrepo�msgrrr�run=sB
$

"zReinstallCommand.runN)r	r
)�__name__�
__module__�__qualname__�__doc__�aliasesrZsummary�staticmethodrrr.rrrrr!sr)Z
__future__rrZdnf.clirZdnf.cli.option_parserrZdnf.i18nrZdnf.exceptionsrZloggingZ	getLoggerr%ZCommandrrrrr�<module>s


?>