name : reinstall.cpython-39.opt-1.pyc
a

�!c]�@slddlmZddlmZddlmZddlmZddlmZddl	Z
ddlZe�d�Z
Gdd	�d	ej�ZdS)
�)�absolute_import)�unicode_literals)�commands)�OptionParser)�_N�dnfc@s8eZdZdZdZed�Zedd��Zdd�Z	dd	�Z
d
S)�ReinstallCommandzSA class containing methods needed by the cli to execute the reinstall command.
    )�	reinstallZreizreinstall a packagecCs"|jddtd�tjtd�d�dS)N�packages�+zPackage to reinstallZPACKAGE)�nargs�help�action�metavar)�add_argumentrrZParseSpecGroupFileCallback)�parser�r�>/usr/lib/python3.9/site-packages/dnf/cli/commands/reinstall.py�
set_argparser(s�zReinstallCommand.set_argparsercCsH|jj}d|_d|_d|_d|_t�|j|j�|j	j
sDt�|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}|jj|jjd|jjjd�D]N}z|j�|�Wn4tjj	yht
�td�|jjj
�|j��Yq 0d}q |jjdd�|jjD�D�] }z|j�|�W�ntjj�y}zT|jD]$}t
�td�|jj
�|j��q�q�t
�td�|jjj
�|��WYd}~q�d}~0tjj�y�}z`|jD]L}d}|jj�|�}|�rVtd	�|}td
�}t
�||jjj
�|�|��q.WYd}~q�d}~0tjj	�y�Yq�0d}q�|�s�tj�td���dS)NF)�strict�progresszNo match for argument: %sTcSsg|]}d|�qS)�@r)�.0�xrrr�
<listcomp>L�z(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)rZdone�pkgZpkg_spec�errZxmsgZpkgrepo�msgrrr�run=sL�

�
 

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


© 2025 Cubjrnet7