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__/upgrade.cpython-36.pyc

3

�ft`~�@stddlmZddlmZddlZddlZddlZddlmZddl	m
Z
ddlmZej
d�ZGdd	�d	ej�ZdS)
�)�absolute_import)�unicode_literalsN)�commands)�OptionParser)�_�dnfc@sXeZdZdZdZed�Zed	d
��Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)�UpgradeCommandzTA class containing methods needed by the cli to execute the
    update command.
    �upgrade�update�
upgrade-to�	update-to�localupdate�upz,upgrade a package or packages on your systemcCs"|jddtd�tjtd�d�dS)NZpackages�*zPackage to upgradeZPACKAGE)�nargs�help�action�metavar)�add_argumentrrZParseSpecGroupFileCallback)�parser�r�/usr/lib/python3.6/upgrade.py�
set_argparser*szUpgradeCommand.set_argparsercCsZ|jj}d|_d|_d|_d|_tj|j|j�|j	j
sDtj|j�d|_d|_
d|_dS)z�Verify that conditions are met so that this command can run.

        These include that there are enabled repositories with gpg
        keys, and that this command is being run by the root user.
        TN)�cli�demandsZsack_activationZavailable_reposZ	resolvingZ	root_userrZ_checkGPGKey�base�opts�	filenamesZ_checkEnabledRepo�upgrade_minimal�all_security�skipped_grp_specs)�selfrrrr�	configure0szUpgradeCommand.configurecCs�|jr
dnd}|jj|j||jd�|jjs<|jjs<|jjrzd}||j�O}||j	�O}||j
�O}||j�O}|r�dSn|jj
�dStjjtd���dS)N�eqZgte)�cmp_type�allFzNo packages marked for upgrade.)rrZ _populate_update_security_filterrrr�	pkg_specs�	grp_specs�_update_modules�
_update_files�_update_packages�_update_groupsrZupgrade_allr�
exceptions�Errorr)r!r$�resultrrr�runBs

zUpgradeCommand.runcCsNt|jj�}tjjr6tjjj|j�}|j	|jj�|_
n
|jj|_
t|j
�|kS)N)�lenrr'rrZWITH_MODULES�module�module_baseZ
ModuleBaser	r )r!Zgroup_specs_numr2rrrr(Vs
zUpgradeCommand._update_modulescCs�d}|jjr�x~|jj|jjd|jjjd�D]^}y|jj|�d}Wq*tjj	k
r�}z$t
jtd�|jjj
j|j��WYdd}~Xq*Xq*W|S)NF)�strict�progressTzNo match for argument: %s)rrrZadd_remote_rpms�outputr4Zpackage_upgraderr,�MarkingError�logger�infor�term�bold�location)r!�successZpkg�errrr)`s
*zUpgradeCommand._update_filescCsrd}xh|jjD]\}y|jj|�d}Wqtjjk
rh}z"tjt	d�|jj
jj|��WYdd}~XqXqW|S)NFTzNo match for argument: %s)
rr&rr	rr,r6r7r8rr5r9r:)r!r<Zpkg_specr=rrrr*ms
(zUpgradeCommand._update_packagescCs|jr|jj|j�dSdS)NTF)r rZenv_group_upgrade)r!rrrr+xszUpgradeCommand._update_groupsN)r	r
rrr
r)�__name__�
__module__�__qualname__�__doc__�aliasesrZsummary�staticmethodrr"r/r(r)r*r+rrrrr#s

r)Z
__future__rrZloggingZdnf.exceptionsrZdnf.baseZdnf.clirZdnf.cli.option_parserrZdnf.i18nrZ	getLoggerr7ZCommandrrrrr�<module>s


Zerion Mini Shell 1.0