Edit File: __init__.cpython-36.pyc
3 �ft`{}������������������@���s��d�Z�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlZ ddl Z ddlZ ddlZ ddl Z ddlZe jd�Zed�d �Zed �d�Zed�Zd d��Zf�fdd�ZG�dd��de�ZG�dd��de�ZG�dd��de�ZG�dd��de�ZG�dd��de�ZG�dd��de�ZG�dd��de�ZdS�)z< Classes for subcommands of the yum command line interface. �����)�print_function)�unicode_literals)�OptionParser)�_N�dnfz+To diagnose the problem, try running: '%s'.zrpm -Va --nofiles --nodigestzDYou probably have corrupted RPMDB, running '%s' might fix the issue.zrpm --rebuilddba��You have enabled checking of packages via GPG keys. This is a good thing. However, you do not have any GPG public keys installed. You need to download the keys for packages you wish to install and install them. You can do that by running the command: rpm --import public.gpg.key Alternatively you can specify the url to the key you would like to use for a repository in the 'gpgkey' option in a repository section and {prog} will install it for you. For more information contact your distribution or package provider.c�������������C���sp���|�j�jsdS�|�j��slxV|�jj��D�]H}|js0|jr |j�r tjdt j tjj d���tjtd�|��tjj�q W�dS�)z�Verify that there are gpg keys for the enabled repositories in the rpm database. :param base: a :class:`dnf.Base` object. :raises: :class:`cli.CliError` Nz %s )�progzProblem repository: %s)�confZgpgcheckZ_gpg_key_check�reposZiter_enabledZ repo_gpgcheckZgpgkey�loggerZcritical�gpg_msg�formatr����util�MAIN_PROG_UPPERr����cli�CliError)�baser����repo��r����/usr/lib/python3.6/__init__.py�_checkGPGKey:���s����r���c�������������C���s|���|�j�j��rdS�xD|D�]<}|jd�r2tjj|�r2dS�tjjj|�d�}|d krdS�qW�t d�j d j|�jj ��}tjj|��dS�)z�Verify that there is at least one enabled repo. :param base: a :class:`dnf.Base` object. :param possible_local_files: the list of strings that could be a local rpms :raises: :class:`cli.CliError`: Nz.rpmr����http�ftp�file�httpsz*There are no enabled repositories in "{}".z", ")r���r���r���r���)r ���Z_any_enabled�endswith�os�path�existsr���ZpycompZurlparser���r����joinr���Zreposdirr���r���)r���Zpossible_local_filesZlfile�scheme�msgr���r���r����_checkEnabledRepoK���s���� r!���c���������������@���s����e�Zd�ZdZg�ZdZdZdd��Zedd���Z edd ���Z ed d���Zdd ��Zdd��Z dd��Zdd��Zdd��Zdd��Zdd��ZdS�)�Commandz%Abstract base class for CLI commands.��Nc�������������C���s ���||�_�d�S�)N)r���)�selfr���r���r���r����__init__f���s����zCommand.__init__c�������������C���s���|�j�jS�)N)r���r���)r$���r���r���r���r���j���s����zCommand.basec�������������C���s ���|�j�d�S�)Nr���)�aliases)r$���r���r���r����_basecmdo���s����zCommand._basecmdc�������������C���s ���|�j�jjS�)N)r���r����output)r$���r���r���r���r(���s���s����zCommand.outputc�������������C���s���dS�)z4Define command specific options and arguments. #:apiNr���)r$����parserr���r���r���� set_argparserw���s����zCommand.set_argparserc�������������C���s���dS�)z*Do any command-specific pre-configuration.Nr���)r$���r���r���r���� pre_configure{���s����zCommand.pre_configurec�������������C���s���dS�)z&Do any command-specific configuration.Nr���)r$���r���r���r���� configure����s����zCommand.configurec�������������C���s&���t�|tjj�rttfS�td|���dS�)z.Get suggestions for resolving the given error.zerror not supported yet: %sN)� isinstancer���� exceptionsZTransactionCheckError�_RPM_VERIFY�_RPM_REBUILDDB�NotImplementedError)r$����errorr���r���r����get_error_output����s����zCommand.get_error_outputc�������������C���s���dS�)zExecute the command.Nr���)r$���r���r���r����run����s����zCommand.runc�������������C���s���dS�)z$Finalize operation after resolvementNr���)r$���r���r���r����run_resolved����s����zCommand.run_resolvedc�������������C���s���dS�)z%Finalize operations post-transaction.Nr���)r$���r���r���r����run_transaction����s����zCommand.run_transaction)�__name__� __module__�__qualname__�__doc__r&����summary�optsr%����propertyr���r'���r(���r*���r+���r,���r3���r4���r5���r6���r���r���r���r���r"���_���s���r"���c������������ ���@���sR���e�Zd�ZdZdZed�ZdZddddd d ddeh Ze d d���Z dd��Zdd��ZdS�)�InfoCommandzRA class containing methods needed by the cli to execute the info command. �infoz4display details about a package or group of packages�all� available� installed�extras�updates�upgrades� autoremove�recent� obsoletesc���������� ���C���s����|j���}|jddddd�td�d��|jddddtd �d ��|jddddtd �d ��|jddddtd�d ��|jddddtd�d ��|jddddtd�d ��|jddddtd�d ��|jddddtd�d ��|jddtd�|�j|�jtjtd�d��d�S�) Nz--all�_packages_action�store_constr@���zshow all packages (default))�dest�action�const�default�helpz--availablerA���zshow only available packages)rK���rL���rM���rO���z--installedrB���zshow only installed packagesz--extrasrC���zshow only extras packagesz --updatesrE���zshow only upgrades packagesz --upgradesz--autoremoverF���zshow only autoremove packagesz--recentrG���z#show only recently changed packages�packages�*�PACKAGEzPackage name specification)�nargs�metavar�choicesrN���rL���rO���)�add_mutually_exclusive_group�add_argumentr���� pkgnarrows�DEFAULT_PKGNARROWr����PkgNarrowCallback)�clsr)����narrowsr���r���r���r*�������s:����zInfoCommand.set_argparserc�������������C���s|���|�j�j}d|_|�jjr"|�jj|�j_|�jjdkr4d|_|�jjrd|�jjr\|�j�jdd|�jj���nd|�j_|�jjdkrxd|�j_d�S�)NTrB���z--obsoletesz--rH���rD���rE���) r����demands�sack_activationr<���rI����packages_action�available_reposrH����_option_conflict)r$���r]���r���r���r���r,�������s����zInfoCommand.configurec�������������C���s&���|�j�j|�j��|�jjd|�jj|�jj�S�)Nr?���)r���� _populate_update_security_filterr<���r����output_packagesr_���rP���)r$���r���r���r���r4�������s����zInfoCommand.runN)r?���) r7���r8���r9���r:���r&���r���r;���rY���rX����classmethodr*���r,���r4���r���r���r���r���r>�������s��� r>���c���������������@���s$���e�Zd�ZdZdZed�Zdd��ZdS�) �ListCommandzRA class containing methods needed by the cli to execute the list command. �list�lsz$list a package or groups of packagesc�������������C���s&���|�j�j|�j��|�jjd|�jj|�jj�S�)Nrf���)r���rb���r<���r���rc���r_���rP���)r$���r���r���r���r4�������s����zListCommand.runN)rf���rg���)r7���r8���r9���r:���r&���r���r;���r4���r���r���r���r���re�������s���re���c���������������@���s8���e�Zd�ZdZd Zed�Zedd���Zdd ��Z d d��Z dS�)�ProvidesCommandzVA class containing methods needed by the cli to execute the provides command. �provides�whatprovides�provz*find what package provides the given valuec�������������C���s���|�j�ddtd�td�d��d�S�)N� dependency�+ZPROVIDEz#Provide specification to search for)rS���rT���rO���)rW���r���)r)���r���r���r���r*�������s����zProvidesCommand.set_argparserc�������������C���s���|�j�j}d|_d|_d|_d�S�)NTF)r���r]���r`���Zfresh_metadatar^���)r$���r]���r���r���r���r,�������s����zProvidesCommand.configurec�������������C���s���t�jtd���|�jj|�jj�S�)NzSearching Packages: )r ����debugr���r���ri���r<���rl���)r$���r���r���r���r4�������s����zProvidesCommand.runN)ri���rj���rk���)r7���r8���r9���r:���r&���r���r;����staticmethodr*���r,���r4���r���r���r���r���rh�������s���rh���c���������������@���s8���e�Zd�ZdZdZed�Zedd���Zdd��Z d d ��Z dS�) �CheckUpdateCommandzZA class containing methods needed by the cli to execute the check-update command. �check-update� check-upgradez$check for available package upgradesc�������������C���s0���|�j�ddddtd�d��|�j�ddtd �d ��d�S�)Nz--changelogs� changelogsF� store_truezshow changelogs before update)rK���rN���rL���rO���rP���rQ���rR���)rS���rT���)rW���r���)r)���r���r���r���r*�����s����z CheckUpdateCommand.set_argparserc�������������C���s6���|�j�j}d|_d|_d|_|�jjr(d|_t|�j��d�S�)NT) r���r]���r^���r`���Zplugin_filtering_enabledr<���rs���r!���r���)r$���r]���r���r���r���r,�����s����zCheckUpdateCommand.configurec�������������C���sR���|�j�j|�jdd��|�jj|�jjd|�jjd�}|r:d|�j�j_|�jj j rN|�j�j���d�S�)NZgte)Zcmp_typeT)�print_rs����d���)r���rb���r<���r���� check_updatesrP���rs���r]����success_exit_statusr���Zautocheck_running_kernelZ_check_running_kernel)r$����foundr���r���r���r4�����s���� zCheckUpdateCommand.runN)rq���rr���)r7���r8���r9���r:���r&���r���r;���ro���r*���r,���r4���r���r���r���r���rp�������s��� rp���c�������������������s��e�Zd�ZdZG�dd��de�ZG�dd��de�ZG�dd��de�ZG�dd ��d e�ZG�d d��de�Z G�dd ��d e�Z G�dd��de�ZG�dd��de�ZG�dd��de�Z G�dd��de�ZG�dd��de�Zeeeee e eee eehZd%Zed�Z��fdd�Zdd ��Zd!d"��Zd#d$��Z���ZS�)&�RepoPkgsCommandz2Implementation of the repository-packages command.c���������������@���s$���e�Zd�ZdZdZdd��Zdd��ZdS�) z%RepoPkgsCommand.CheckUpdateSubCommandz'Implementation of the info sub-command.�check-updatec�������������C���s���|�j�j}d|_d|_d�S�)NT)r���r]���r`���r^���)r$���r]���r���r���r���r,���(��s����z/RepoPkgsCommand.CheckUpdateSubCommand.configurec�������������C���s*���|�j�j|�jj|�jdd�}|r&d|�jj_dS�)z?Execute the command with respect to given arguments *cli_args*.T)ru���rv���N)r���rw���r<���� pkg_specs�reponamer���r]���rx���)r$���ry���r���r���r����run_on_repo-��s����z1RepoPkgsCommand.CheckUpdateSubCommand.run_on_repoN)r{���)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����CheckUpdateSubCommand#��s���r���c���������������@���s$���e�Zd�ZdZdZdd��Zdd��ZdS�) zRepoPkgsCommand.InfoSubCommandz'Implementation of the info sub-command.r?���c�������������C���sh���|�j�j}d|_|�jjr"|�jj|�j_|�jjdkr4d|_|�jjrd|�jjr\|�j�jdd|�jj���nd|�j_d�S�)NTrB���z--obsoletesz--rH���) r���r]���r^���r<����_pkg_specs_action�pkg_specs_actionr`���rH���ra���)r$���r]���r���r���r���r,���9��s����z(RepoPkgsCommand.InfoSubCommand.configurec�������������C���s.���|�j�j|�j��|�jjd|�jj|�jj|�j��dS�)z?Execute the command with respect to given arguments *cli_args*.r?���N)r���rb���r<���r���rc���r����r|���r}���)r$���r���r���r���r~���F��s����z*RepoPkgsCommand.InfoSubCommand.run_on_repoN)r?���)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����InfoSubCommand4��s��� r����c���������������@���s$���e�Zd�ZdZdZdd��Zdd��ZdS�) z!RepoPkgsCommand.InstallSubCommandz*Implementation of the install sub-command.�installc�������������C���s$���|�j�j}d|_d|_d|_d|_d�S�)NT)r���r]���r`���r^���� resolving� root_user)r$���r]���r���r���r���r,���Q��s ����z+RepoPkgsCommand.InstallSubCommand.configurec�������������C���s����|�j�j|�j��t|�j|�j���d}|�jjsjy|�jjd|�j��W�n&�tj j k rb���tjt d���Y�q�X�d}nvxt|�jjD�]h}y|�jj||�j��W�nJ�tj j k r��}�z*dj|j|�jjjj|��}tj|��W�Y�d�d�}~X�qtX�d}qtW�|s�tj jt d���d�S�)NFrQ���zNo package available.Tz{}: {}zNo packages marked for install.)r���rb���r<���r���r���r|���r����r}���r���r.����MarkingErrorr ���r?���r���r����valuer(����term�bold�Error)r$����done�pkg_spec�er ���r���r���r���r~���X��s$����z-RepoPkgsCommand.InstallSubCommand.run_on_repoN)r����)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����InstallSubCommandL��s���r����c���������������@���s���e�Zd�ZdZdZdd��ZdS�)zRepoPkgsCommand.ListSubCommandz'Implementation of the list sub-command.rf���c�������������C���s.���|�j�j|�j��|�jjd|�jj|�jj|�j��dS�)z?Execute the command with respect to given arguments *cli_args*.rf���N)r���rb���r<���r���rc���r����r|���r}���)r$���r���r���r���r~���z��s����z*RepoPkgsCommand.ListSubCommand.run_on_repoN)rf���)r7���r8���r9���r:���r&���r~���r���r���r���r����ListSubCommandu��s���r����c���������������@���s$���e�Zd�ZdZdZdd��Zdd��ZdS�) z RepoPkgsCommand.MoveToSubCommandz*Implementation of the move-to sub-command.�move-toc�������������C���s$���|�j�j}d|_d|_d|_d|_d�S�)NT)r���r]���r^���r`���r����r����)r$���r]���r���r���r���r,������s ����z*RepoPkgsCommand.MoveToSubCommand.configurec�������������C���s���t�|�j|�j��d}|�jjs�y|�jjd|�jd��W�nl�tjj k rV���t jtd���Y�nL�tjj k rz���t jtd���Y�n(�tjjk r����ds�td��Y�nX�d}n�x�|�jjD�]�}y|�jj||�jd��W�n��tjj k r����td�}t j||��Y�q��tjj k �rp�}�z\xT|jD�]J}d }|�jjj|�}|�r:td �|�}td�}t j||�jjj|�|���qW�W�Y�dd}~X�q��tjjk �r����d�s�td��Y�q�X�d}q�W�|�s�tjjtd ���dS�)z?Execute the command with respect to given arguments *cli_args*.FrQ���)Znew_reponamezNo package installed.zNo package available.z+Only the above marking errors are expected.TzNo match for argument: %sr#���z (from %s)z%Installed package %s%s not available.NzNothing to do.)r���r���r���r<���r|���� reinstallr}���r���r.����PackagesNotInstalledErrorr ���r?���r����PackagesNotAvailableErrorr�����AssertionErrorrP����historyr���r(���r����r����r����)r$���r����r����r ����err�pkg�xmsg�pkgrepor���r���r���r~������s@����.z,RepoPkgsCommand.MoveToSubCommand.run_on_repoN)r����)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����MoveToSubCommand���s���r����c���������������@���s$���e�Zd�ZdZdZdd��Zdd��ZdS�) z&RepoPkgsCommand.ReinstallOldSubCommandz0Implementation of the reinstall-old sub-command.� reinstall-oldc�������������C���s$���|�j�j}d|_d|_d|_d|_d�S�)NT)r���r]���r^���r`���r����r����)r$���r]���r���r���r���r,������s ����z0RepoPkgsCommand.ReinstallOldSubCommand.configurec�������������C���s���t�|�j|�j��d}|�jjs�y|�jjd|�j|�j��W�np�tjj k r\���t d�}tj|��Y�nL�tjj k r����tjt d���Y�n(�tjjk r����ds�td��Y�nX�d}n�x�|�jjD�]�}y|�jj||�j|�j��W�n��tjj k r����t d�}tj||��Y�q��tjj k �rx�}�z\xT|jD�]J}d}|�jjj|�}|�rBt d �|�}t d �}tj||�jjj|�|���qW�W�Y�dd}~X�q��tjjk �r����d�s�td��Y�q�X�d}q�W�|�s�tjjt d���dS�) z?Execute the command with respect to given arguments *cli_args*.FrQ���z)No package installed from the repository.zNo package available.z+Only the above marking errors are expected.TzNo match for argument: %sr#���z (from %s)z%Installed package %s%s not available.NzNothing to do.)r���r���r���r<���r|���r����r}���r���r.���r����r���r ���r?���r����r����r����rP���r����r���r(���r����r����r����)r$���r����r ���r����r����r����r����r����r���r���r���r~������sD����.z2RepoPkgsCommand.ReinstallOldSubCommand.run_on_repoN)r����)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����ReinstallOldSubCommand���s���r����c�������������������s4���e�Zd�ZdZd Z��fdd�Zdd��Zdd��Z���ZS�) z#RepoPkgsCommand.ReinstallSubCommandz,Implementation of the reinstall sub-command.r����c����������������s,���t�tj|��j|��tj|�tj|�f|�_dS�)zInitialize the command.N)�superrz����ReinstallSubCommandr%���r����r�����wrapped_commands)r$���r���)� __class__r���r���r%������s����z,RepoPkgsCommand.ReinstallSubCommand.__init__c�������������C���s6���d|�j�j_x&|�jD�]}|�j|_|�j|_|j���qW�d�S�)NT)r���r]���r`���r����r<���r}���r,���)r$����commandr���r���r���r,������s ���� z-RepoPkgsCommand.ReinstallSubCommand.configurec�������������C���s\���t�|�j|�j��xH|�jD�].}y|j���W�n�tjjk r@���wY�qX�P�qW�tjjtd���dS�)z?Execute the command with respect to given arguments *cli_args*.z!No packages marked for reinstall.N) r���r���r���r����r~���r���r.���r����r���)r$���r����r���r���r���r~�����s����z/RepoPkgsCommand.ReinstallSubCommand.run_on_repo)r����) r7���r8���r9���r:���r&���r%���r,���r~���� __classcell__r���r���)r����r���r�������s ���r����c���������������@���s,���e�Zd�ZdZd Zdd��Zdd��Zdd��Zd S�)z,RepoPkgsCommand.RemoveOrDistroSyncSubCommandz8Implementation of the remove-or-distro-sync sub-command.�remove-or-distro-syncc�������������C���s$���|�j�j}d|_d|_d|_d|_d�S�)NT)r���r]���r`���r^���r����r����)r$���r]���r���r���r���r,�����s ����z6RepoPkgsCommand.RemoveOrDistroSyncSubCommand.configurec������� ���������s����|�j�jjj���tjj|�}|j|�j�jj�}|�j�jj�����fdd�|j ��D��}|s`tj jd|��|j��}|�j�jj j}xD|D�]<}|j|j|jd�r�|�j�jjj|��qz|�j�jjj||d��qzW�dS�)z;Synchronize a package with another repository or remove it.c����������������s���g�|�]}��j�|��kr|�qS�r���)r���)�.0r����)r����r}���r���r���� <listcomp>#��s����zIRepoPkgsCommand.RemoveOrDistroSyncSubCommand._replace.<locals>.<listcomp>zno package matched)�name�arch)� clean_depsN)r���r���ZsackZdisable_repor����subjectZSubjectZget_best_queryr����rB���r.���r����rA���r���Zclean_requirements_on_remove�filterr����r����Z_goalZdistupgradeZerase) r$���r����r}���r����ZmatchesrB���rA���r�����packager���)r����r}���r����_replace��s���� z5RepoPkgsCommand.RemoveOrDistroSyncSubCommand._replacec�������������C���s����t�|�j|�j��d}|�jjs^y|�jd|�j��W�n*�tjj k rV���t d�}tj|��Y�q�X�d}nVxT|�jjD�]H}y|�j||�j��W�n,�tjj k r����t d�}tj||��Y�qhX�d}qhW�|s�tjj t d���dS�)z?Execute the command with respect to given arguments *cli_args*.FrQ���z)No package installed from the repository.TzNo match for argument: %szNothing to do.N)r���r���r���r<���r|���r����r}���r���r.���r����r���r ���r?���r����)r$���r����r ���r����r���r���r���r~���0��s$����z8RepoPkgsCommand.RemoveOrDistroSyncSubCommand.run_on_repoN)r����)r7���r8���r9���r:���r&���r,���r����r~���r���r���r���r����RemoveOrDistroSyncSubCommand��s ���r����c���������������@���s$���e�Zd�ZdZdZdd��Zdd��ZdS�) z+RepoPkgsCommand.RemoveOrReinstallSubCommandz6Implementation of the remove-or-reinstall sub-command.�remove-or-reinstallc�������������C���s$���|�j�j}d|_d|_d|_d|_d�S�)NT)r���r]���r^���r`���r����r����)r$���r]���r���r���r���r,���R��s ����z5RepoPkgsCommand.RemoveOrReinstallSubCommand.configurec���������� ���C���s*��t�|�j|�j��d}|�jjs�y|�jjd|�j|�jdd��W�nL�tjj k r`���t d�}tj|��Y�n(�tjj k r����ds~td��Y�nX�d}n�x�|�jjD�]x}y|�jj||�j|�jdd��W�nR�tjj k r����t d�}tj||��Y�q��tjj k �r���d�std��Y�q�X�d}q�W�|�s&tjjt d���d S�) z?Execute the command with respect to given arguments *cli_args*.FrQ���T)Zold_reponameZnew_reponame_neqZ remove_naz)No package installed from the repository.z)Only the above marking error is expected.zNo match for argument: %szNothing to do.N)r���r���r���r<���r|���r����r}���r���r.���r����r���r ���r?���r����r����r����)r$���r����r ���r����r���r���r���r~���Y��s4����z7RepoPkgsCommand.RemoveOrReinstallSubCommand.run_on_repoN)r����)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����RemoveOrReinstallSubCommandM��s���r����c���������������@���s$���e�Zd�ZdZdZdd��Zdd��ZdS�) z RepoPkgsCommand.RemoveSubCommandz)Implementation of the remove sub-command.�removec�������������C���s*���|�j�j}d|_d|_d|_d|_d|_d�S�)NTF)r���r]���r^���Z allow_erasingr`���r����r����)r$���r]���r���r���r���r,������s����z*RepoPkgsCommand.RemoveSubCommand.configurec�������������C���s����d}|�j�jsRy|�jjd|�j��W�n*�tjjk rJ���td�}t j |��Y�q�X�d}n`x^|�j�jD�]R}y|�jj||�j��W�n4�tjjk r��}�zt j t|���W�Y�dd}~X�q\X�d}q\W�|s�t jtd���dS�)z?Execute the command with respect to given arguments *cli_args*.FrQ���z)No package installed from the repository.TNzNo packages marked for removal.) r<���r|���r���r����r}���r���r.���r����r���r ���r?����strZwarning)r$���r����r ���r����r����r���r���r���r~������s ���� z,RepoPkgsCommand.RemoveSubCommand.run_on_repoN)r����)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����RemoveSubCommand~��s���r����c���������������@���s$���e�Zd�ZdZd Zdd��Zdd��ZdS�) z!RepoPkgsCommand.UpgradeSubCommandz*Implementation of the upgrade sub-command.�upgrade� upgrade-toc�������������C���s$���|�j�j}d|_d|_d|_d|_d�S�)NT)r���r]���r^���r`���r����r����)r$���r]���r���r���r���r,������s ����z+RepoPkgsCommand.UpgradeSubCommand.configurec�������������C���s����t�|�j|�j��d}|�jjs.|�jj|�j��d}nTxR|�jjD�]F}y|�jj||�j��W�n(�tj j k rx���tjt d�|��Y�q8X�d}q8W�|s�tj jt d���dS�)z?Execute the command with respect to given arguments *cli_args*.FTzNo match for argument: %szNo packages marked for upgrade.N)r���r���r���r<���r|���Zupgrade_allr}���r����r���r.���r����r ���r?���r���r����)r$���r����r����r���r���r���r~������s����z-RepoPkgsCommand.UpgradeSubCommand.run_on_repoN)r����r����)r7���r8���r9���r:���r&���r,���r~���r���r���r���r����UpgradeSubCommand���s���r�����repository-packages� repo-pkgs� repo-packages�repository-pkgsz7run commands on top of all packages in given repositoryc����������������s>���t�t|��j������fdd�|�jD��}d|�_dd��|D��|�_dS�)zInitialize the command.c�������������3���s���|�]}|���V��qd�S�)Nr���)r�����subcmd)r���r���r���� <genexpr>���s����z+RepoPkgsCommand.__init__.<locals>.<genexpr>Nc�������������S���s���i�|�]}|j�D�] }||�qqS�r���)r&���)r����r�����aliasr���r���r���� <dictcomp>���s���z,RepoPkgsCommand.__init__.<locals>.<dictcomp>)r����rz���r%����SUBCMDSr�����_subcmd_name2obj)r$���r���Zsubcmd_objs)r����)r���r���r%������s ����zRepoPkgsCommand.__init__c���������� ���C���s`��|j���}|jddddd�td�d��|jddddtd �d ��|jddddtd �d ��|jddddtd�d ��|jddddtd�d ��|jddddtd�d ��|jddddtd�d ��|jddddtd�d ��|jddtjtd�td�d��d d!��|�jD��}d"d!��|�jD��}|jd#dd$|d%j|�d&��d}|ddddd'ddh}|jd(d)td*�||tjtd+�d,��d�S�)-Nz--allr����rJ���r@���zshow all packages (default))rK���rL���rM���rN���rO���z--availablerA���zshow only available packages)rK���rL���rM���rO���z--installedrB���zshow only installed packagesz--extrasrC���zshow only extras packagesz --updatesrE���zshow only upgrades packagesz --upgradesz--autoremoverF���zshow only autoremove packagesz--recentrG���z#show only recently changed packagesr}�������ZREPOIDz Repository ID)rS���rL���rT���rO���c�������������S���s���g�|�]}|j�d���qS�)r���)r&���)r����r����r���r���r���r�������s����z1RepoPkgsCommand.set_argparser.<locals>.<listcomp>c�������������S���s���g�|�]}|j�D�]}|�qqS�r���)r&���)r����r����r����r���r���r���r�������s����r����Z SUBCOMMANDz, )rS���rT���rU���rO���rH���r|���rQ���rR���zPackage specification)rS���rT���rU���rN���rL���rO���)rV���rW���r���r���Z_RepoCallbackEnabler����r���rZ���)r$���r)���r\���Zsubcommand_choicesZsubcommand_choices_allrY���rX���r���r���r���r*������sP���� zRepoPkgsCommand.set_argparserc�������������C���s����y|�j�|�jjd��|�_W�n>�tjjtfk rV�}�z|�jjj���tjj�W�Y�dd}~X�nX�|�j|�j_|�jj d�|�j_ |�jj ���dS�)z8Verify whether the command can run with given arguments.r���N)r����r<���r����r���r���r����KeyError� optparserZprint_usager}���r,���)r$���r����r���r���r���r,�����s���� zRepoPkgsCommand.configurec�������������C���s���|�j�j���dS�)z>Execute the command with respect to given arguments *extcmds*.N)r����r~���)r$���r���r���r���r4�����s����zRepoPkgsCommand.run)r����r����r����r����)r7���r8���r9���r:���r"���r���r����r����r����r����r����r����r����r����r����r����r����r&���r���r;���r%���r*���r,���r4���r����r���r���)r����r���rz��� ��s0���)79>1(#�+rz���c���������������@���s0���e�Zd�ZdZd Zed�Zedd���Zdd��Z dS�) �HelpCommandzRA class containing methods needed by the cli to execute the help command. rO���zdisplay a helpful usage messagec�������������C���s*���|�j�ddtd�td�jtjjd�d��d�S�)N�cmd�?ZCOMMANDz{prog} command to get help for)r���)rS���rT���rO���)rW���r���r���r���r ���r���)r)���r���r���r���r*�����s����zHelpCommand.set_argparserc�������������C���sN���|�j�j�s|�j�j|�jjkr(|�jjj���n"|�jj|�j�j�}|�jjj||����d�S�)N)r<���r����r���Zcli_commandsr����Z print_help)r$���r����r���r���r���r4���$��s ���� zHelpCommand.runN)rO���) r7���r8���r9���r:���r&���r���r;���ro���r*���r4���r���r���r���r���r������s ���r����)r:���Z __future__r���r���Zdnf.cli.option_parserr���Zdnf.i18nr���Zdnf.clir���Zdnf.exceptionsZ dnf.pycompZdnf.utilZloggingr���Z getLoggerr ���r/���r0���r���r���r!����objectr"���r>���re���rh���rp���rz���r����r���r���r���r����<module>���s:��� 9?$���y