<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
ft`{}                 @   s  d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZ	ddl
Z	ddlZ	ddlZ	ddlZddlZejdZedd	 Zed
d ZedZdd Zf fddZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )z<
Classes for subcommands of the yum command line interface.
    )print_function)unicode_literals)OptionParser)_Ndnfz+To diagnose the problem, try running: '%s'.zrpm -Va --nofiles --nodigestzDYou probably have corrupted RPMDB, running '%s' might fix the issue.zrpm --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 jsdS | j slxV| jj D ]H}|js0|jr |j r tjdt	j
tjjd tjtd| tjjq W dS )zVerify 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
)progzProblem repository: %s)confZgpgcheckZ_gpg_key_checkreposZiter_enabledZrepo_gpgcheckZgpgkeyloggerZcritical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 rdS xD|D ]<}|jdr2tjj|r2dS tjjj|d }|d
krdS qW t	dj
d	j| jj}tjj|dS )zVerify 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   ZpycompZurlparser   r   joinr   Zreposdirr   r   )r   Zpossible_local_filesZlfileschememsgr   r   r   _checkEnabledRepoK   s    

r!   c               @   s   e Zd ZdZg ZdZdZdd Zedd Z	edd	 Z
ed
d Zdd Zdd Zdd Zdd Zdd Zdd Zdd ZdS )Commandz%Abstract base class for CLI commands. Nc             C   s
   || _ d S )N)r   )selfr   r   r   r   __init__f   s    zCommand.__init__c             C   s   | j jS )N)r   r   )r$   r   r   r   r   j   s    zCommand.basec             C   s
   | j d S )Nr   )aliases)r$   r   r   r   _basecmdo   s    zCommand._basecmdc             C   s
   | j jjS )N)r   r   output)r$   r   r   r   r(   s   s    zCommand.outputc             C   s   dS )z4Define command specific options and arguments. #:apiNr   )r$   parserr   r   r   set_argparserw   s    zCommand.set_argparserc             C   s   dS )z*Do any command-specific pre-configuration.Nr   )r$   r   r   r   pre_configure{   s    zCommand.pre_configurec             C   s   dS )z&Do any command-specific configuration.Nr   )r$   r   r   r   	configure   s    zCommand.configurec             C   s&   t |tjjrttfS td| dS )z.Get suggestions for resolving the given error.zerror not supported yet: %sN)
isinstancer   
exceptionsZTransactionCheckError_RPM_VERIFY_RPM_REBUILDDBNotImplementedError)r$   errorr   r   r   get_error_output   s    zCommand.get_error_outputc             C   s   dS )zExecute the command.Nr   )r$   r   r   r   run   s    zCommand.runc             C   s   dS )z$Finalize operation after resolvementNr   )r$   r   r   r   run_resolved   s    zCommand.run_resolvedc             C   s   dS )z%Finalize operations post-transaction.Nr   )r$   r   r   r   run_transaction   s    zCommand.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 Zd ZdZdZedZdZddddd	d
ddeh	Ze	dd Z
dd Zdd ZdS )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  }|jddddd tdd |jddddtd	d
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddtd| j| jtjtdd d S ) Nz--all_packages_actionstore_constr@   zshow all packages (default))destactionconstdefaulthelpz--availablerA   zshow only available packages)rK   rL   rM   rO   z--installedrB   zshow only installed packagesz--extrasrC   zshow only extras packagesz	--updatesrE   zshow only upgrades packagesz
--upgradesz--autoremoverF   zshow only autoremove packagesz--recentrG   z#show only recently changed packagespackages*PACKAGEzPackage name specification)nargsmetavarchoicesrN   rL   rO   )add_mutually_exclusive_groupadd_argumentr   
pkgnarrowsDEFAULT_PKGNARROWr   PkgNarrowCallback)clsr)   narrowsr   r   r   r*      s:    zInfoCommand.set_argparserc             C   s|   | j j}d|_| jjr"| jj| j_| jjdkr4d|_| jjrd| jjr\| j jdd| jj  nd| j_| jjdkrxd| 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    zInfoCommand.configurec             C   s&   | j j| j | jjd| jj| jjS )Nr?   )r    _populate_update_security_filterr<   r   output_packagesr_   rP   )r$   r   r   r   r4      s    zInfoCommand.runN)r?   )r7   r8   r9   r:   r&   r   r;   rY   rX   classmethodr*   r,   r4   r   r   r   r   r>      s   
 r>   c               @   s$   e Zd ZdZdZedZdd ZdS )	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 | jjd| jj| jjS )Nrf   )r   rb   r<   r   rc   r_   rP   )r$   r   r   r   r4      s    zListCommand.runN)rf   rg   )r7   r8   r9   r:   r&   r   r;   r4   r   r   r   r   re      s   re   c               @   s8   e Zd ZdZdZedZedd Zdd	 Z	d
d Z
dS )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 ddtdtdd d S )N
dependency+ZPROVIDEz#Provide specification to search for)rS   rT   rO   )rW   r   )r)   r   r   r   r*      s    zProvidesCommand.set_argparserc             C   s   | j j}d|_d|_d|_d S )NTF)r   r]   r`   Zfresh_metadatar^   )r$   r]   r   r   r   r,      s    zProvidesCommand.configurec             C   s   t jtd | jj| jjS )NzSearching Packages: )r
   debugr   r   ri   r<   rl   )r$   r   r   r   r4      s    zProvidesCommand.runN)ri   rj   rk   )r7   r8   r9   r:   r&   r   r;   staticmethodr*   r,   r4   r   r   r   r   rh      s   rh   c               @   s8   e Zd ZdZdZedZedd Zdd Z	d	d
 Z
dS )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 ddddtdd | j ddtd	d
 d S )Nz--changelogs
changelogsF
store_truezshow 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|_| jjr(d|_t| j d S )NT)	r   r]   r^   r`   Zplugin_filtering_enabledr<   rs   r!   r   )r$   r]   r   r   r   r,     s    zCheckUpdateCommand.configurec             C   sR   | j j| jdd | jj| jjd| jjd}|r:d| j j_| jj	j
rN| j j  d S )NZgte)Zcmp_typeT)print_rs   d   )r   rb   r<   r   check_updatesrP   rs   r]   success_exit_statusr   Zautocheck_running_kernelZ_check_running_kernel)r$   foundr   r   r   r4     s    

zCheckUpdateCommand.runN)rq   rr   )r7   r8   r9   r:   r&   r   r;   ro   r*   r,   r4   r   r   r   r   rp      s   	rp   c                   s  e Zd ZdZG dd deZG dd deZG dd deZG dd	 d	eZG d
d deZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZG dd deZeeeee	e
eeeeehZd%ZedZ fddZdd  Zd!d" Zd#d$ Z  ZS )&RepoPkgsCommandz2Implementation of the repository-packages command.c               @   s$   e Zd ZdZdZdd Zdd ZdS )	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| jj| jdd}|r&d| jj_dS )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 Zd ZdZdZdd Zdd ZdS )	zRepoPkgsCommand.InfoSubCommandz'Implementation of the info sub-command.r?   c             C   sh   | j j}d|_| jjr"| jj| j_| jjdkr4d|_| jjrd| jjr\| j jdd| jj  nd| 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 | jjd| jj| jj| j dS )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 Zd ZdZdZdd Zdd ZdS )	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}| jjsjy| jjd| j W n& tj	j
k
rb   tjtd Y qX d}nvxt| jjD ]h}y| jj|| j W nJ tj	j
k
r } z*dj|j| jjjj|}tj| W Y d d }~X qtX d}qtW |stj	jtdd S )NFrQ   zNo package available.Tz{}: {}zNo 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 Zd ZdZdZdd ZdS )zRepoPkgsCommand.ListSubCommandz'Implementation of the list sub-command.rf   c             C   s.   | j j| j | jjd| jj| jj| j dS )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 Zd ZdZdZdd Zdd ZdS )	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}| jjsy| jjd| jd W nl tjj	k
rV   t
jtd Y nL tjjk
rz   t
jtd Y n( tjjk
r   dstdY nX d}nx| jjD ]}y| jj|| jd W n tjj	k
r   td}t
j|| Y q tjjk
rp } z\xT|jD ]J}d	}| jjj|}|r:td
| }td}t
j|| jjj|| qW W Y dd}~X q tjjk
r   dstdY qX d}qW |stjjtddS )z?Execute the command with respect to given arguments *cli_args*.FrQ   )Znew_reponamezNo package installed.zNo package available.z+Only the above marking errors are expected.TzNo match for argument: %sr#   z
 (from %s)z%Installed package %s%s not available.NzNothing 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 Zd ZdZdZdd Zdd ZdS )	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}| jjsy| jjd| j| j W np tjj	k
r\   t
d}tj| Y nL tjjk
r   tjt
d Y n( tjjk
r   dstdY nX d}nx| jjD ]}y| jj|| j| j W n tjj	k
r   t
d}tj|| Y q tjjk
rx } z\xT|jD ]J}d}| jjj|}|rBt
d	| }t
d
}tj|| jjj|| qW W Y dd}~X q tjjk
r   dstdY qX d}qW |stjjt
ddS )z?Execute the command with respect to given arguments *cli_args*.FrQ   z)No package installed from the repository.zNo package available.z+Only the above marking errors are expected.TzNo match for argument: %sr#   z
 (from %s)z%Installed package %s%s not available.NzNothing 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 Zd ZdZd	Z fddZdd Zdd Z  ZS )
z#RepoPkgsCommand.ReinstallSubCommandz,Implementation of the reinstall sub-command.r   c                s,   t tj| j| tj|tj|f| _dS )zInitialize 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&| jD ]}| j|_| j|_|j  qW 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| jD ].}y|j  W n tjjk
r@   wY qX P qW tjjtddS )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 Zd ZdZd
Zdd Zdd Zdd Zd	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 jjj tjj|}|j| j jj}| j jj  fdd|j	 D }|s`tj
jd||j }| j jjj}xD|D ]<}|j|j|jdr| j jjj| qz| j jjj||d qzW dS )z;Synchronize a package with another repository or remove it.c                s   g | ]} j |kr|qS r   )r   ).0r   )r   r}   r   r   
<listcomp>#  s    zIRepoPkgsCommand.RemoveOrDistroSyncSubCommand._replace.<locals>.<listcomp>zno package matched)namearch)
clean_depsN)r   r   ZsackZdisable_repor   subjectZSubjectZget_best_queryr   rB   r.   r   rA   r   Zclean_requirements_on_removefilterr   r   Z_goalZdistupgradeZerase)	r$   r   r}   r   ZmatchesrB   rA   r   packager   )r   r}   r   _replace  s    

z5RepoPkgsCommand.RemoveOrDistroSyncSubCommand._replacec             C   s   t | j| j d}| jjs^y| jd| j W n* tjj	k
rV   t
d}tj| Y qX d}nVxT| jjD ]H}y| j|| j W n, tjj	k
r   t
d}tj|| Y qhX d}qhW |stjjt
ddS )z?Execute the command with respect to given arguments *cli_args*.FrQ   z)No package installed from the repository.TzNo match for argument: %szNothing 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 Zd ZdZdZdd Zdd ZdS )	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}| jjsy| jjd| j| jdd W nL tjj	k
r`   t
d}tj| Y n( tjjk
r   ds~tdY nX d}nx| jjD ]x}y| jj|| j| jdd W nR tjj	k
r   t
d}tj|| Y q tjjk
r   dstdY qX d}qW |s&tjjt
dd	S )
z?Execute the command with respect to given arguments *cli_args*.FrQ   T)Zold_reponameZnew_reponame_neqZ	remove_naz)No package installed from the repository.z)Only the above marking error is expected.zNo match for argument: %szNothing 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 Zd ZdZdZdd Zdd ZdS )	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 jsRy| jjd| j W n* tjjk
rJ   td}t	j
| Y qX d}n`x^| j jD ]R}y| jj|| j W n4 tjjk
r } zt	j
t| W Y dd}~X q\X d}q\W |st	jtd dS )z?Execute the command with respect to given arguments *cli_args*.FrQ   z)No package installed from the repository.TNzNo packages marked for removal.)r<   r|   r   r   r}   r   r.   r   r   r
   r?   strZwarning)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 Zd ZdZd	Zdd Zdd ZdS )
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}| jjs.| jj| j d}nTxR| jjD ]F}y| jj|| j W n( tj	j
k
rx   tjtd| Y q8X d}q8W |stj	jtddS )z?Execute the command with respect to given arguments *cli_args*.FTzNo match for argument: %szNo packages marked for upgrade.N)r   r   r   r<   r|   Zupgrade_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   fdd| jD }d| _dd |D | _dS )zInitialize the command.c             3   s   | ]}| V  qd S )Nr   )r   subcmd)r   r   r   	<genexpr>  s    z+RepoPkgsCommand.__init__.<locals>.<genexpr>Nc             S   s   i | ]}|j D ]
}||qqS r   )r&   )r   r   aliasr   r   r   
<dictcomp>  s   z,RepoPkgsCommand.__init__.<locals>.<dictcomp>)r   rz   r%   SUBCMDSr   _subcmd_name2obj)r$   r   Zsubcmd_objs)r   )r   r   r%     s
    zRepoPkgsCommand.__init__c          	   C   s`  |j  }|jddddd tdd |jddddtd	d
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddddtdd
 |jddtjtdtdd d d! | jD }d"d! | jD }|jd#dd$|d%j|d& d}|ddddd'ddh}|jd(d)td*||tjtd+d, d S )-Nz--allr   rJ   r@   zshow all packages (default))rK   rL   rM   rN   rO   z--availablerA   zshow only available packages)rK   rL   rM   rO   z--installedrB   zshow only installed packagesz--extrasrC   zshow only extras packagesz	--updatesrE   zshow only upgrades packagesz
--upgradesz--autoremoverF   zshow only autoremove packagesz--recentrG   z#show only recently changed packagesr}      ZREPOIDzRepository ID)rS   rL   rT   rO   c             S   s   g | ]}|j d  qS )r   )r&   )r   r   r   r   r   r     s    z1RepoPkgsCommand.set_argparser.<locals>.<listcomp>c             S   s   g | ]}|j D ]}|qqS r   )r&   )r   r   r   r   r   r   r     s    r   Z
SUBCOMMANDz, )rS   rT   rU   rO   rH   r|   rQ   rR   zPackage specification)rS   rT   rU   rN   rL   rO   )rV   rW   r   r   Z_RepoCallbackEnabler   r   rZ   )r$   r)   r\   Zsubcommand_choicesZsubcommand_choices_allrY   rX   r   r   r   r*     sP    
zRepoPkgsCommand.set_argparserc             C   s   y| j | jjd  | _W n> tjjtfk
rV } z| jjj  tjjW Y dd}~X nX | j| j_| jj	d | j_	| jj
  dS )z8Verify whether the command can run with given arguments.r   N)r   r<   r   r   r   r   KeyError	optparserZprint_usager}   r,   )r$   r   r   r   r   r,     s    
zRepoPkgsCommand.configurec             C   s   | j j  dS )z>Execute the command with respect to given arguments *extcmds*.N)r   r~   )r$   r   r   r   r4     s    zRepoPkgsCommand.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   )79>1(# +rz   c               @   s0   e Zd ZdZd	ZedZedd Zdd Z	dS )
HelpCommandzRA class containing methods needed by the cli to execute the
    help command.
    rO   zdisplay a helpful usage messagec             C   s*   | j ddtdtdjtjjdd d S )Ncmd?ZCOMMANDz{prog} command to get help for)r   )rS   rT   rO   )rW   r   r   r   r   r   )r)   r   r   r   r*     s    zHelpCommand.set_argparserc             C   sN   | j j s| j j| jjkr(| jjj  n"| jj| j j }| jjj||  d S )N)r<   r   r   Zcli_commandsr   Z
print_help)r$   r   r   r   r   r4   $  s
    
zHelpCommand.runN)rO   )
r7   r8   r9   r:   r&   r   r;   ro   r*   r4   r   r   r   r   r     s
   r   )r:   Z
__future__r   r   Zdnf.cli.option_parserr   Zdnf.i18nr   Zdnf.clir   Zdnf.exceptionsZ
dnf.pycompZdnf.utilZloggingr   Z	getLoggerr
   r/   r0   r   r   r!   objectr"   r>   re   rh   rp   rz   r   r   r   r   r   <module>   s:   
9?$   y