관리-도구
편집 파일: __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&