a
!c] @ sl d dl mZ d dl mZ d dlmZ d dlmZ d dlmZ d dl Z
d dlZedZ
G dd d ejZdS )
)absolute_import)unicode_literals)commands)OptionParser)_Ndnfc @ s8 e Zd ZdZdZedZedd Zdd Z dd Z
d
S )ReinstallCommandzSA class containing methods needed by the cli to execute the reinstall command.
) reinstallZreizreinstall a packagec C s" | j ddtdtjtdd d S )Npackages+zPackage to reinstallZPACKAGE)nargshelpactionmetavar)add_argumentr r ZParseSpecGroupFileCallback)parser r >/usr/lib/python3.9/site-packages/dnf/cli/commands/reinstall.py
set_argparser( s zReinstallCommand.set_argparserc C sH | j j}d|_d|_d|_d|_t| j| j | j j
sDt| j dS )a Verify 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)ZclidemandsZsack_activationZavailable_reposZ resolvingZ root_userr Z_checkGPGKeybaseopts filenamesZ_checkEnabledRepo)selfr r r r configure. s zReinstallCommand.configurec C s d}| j j| jjd| j jjdD ]N}z| j | W n4 tjj yh t
td| j jj
|j Y q 0 d}q | jjdd | jjD D ].}z| j | W n tjjy } zT|jD ]$}t
td| jj
|j qqt
td| j jj
| W Y d }~qd }~0 tjjy } z`|jD ]L}d}| j j|}|rVtd | }td
}t
|| j jj
|| q.W Y d }~qd }~0 tjj y dsJ dY q0 d}q|stjtdd S )
NF)strictprogresszNo match for argument: %sTc S s g | ]}d | qS )@r ).0xr r r