관리-도구
편집 파일: download.cpython-36.pyc
3 �gt`*0 � @ s� d dl mZ d dl mZ d dlmZmZ d dlmZ d dlZd dl Zd dl Zd dlZd dlZd dl Zd dlZd dlZd dlZd dlZejjG dd� dejj��ZdS )� )�absolute_import)�unicode_literals)�_�logger)�OptionParserNc s� e Zd ZdgZed�Z� fdd�Zedd� �Zdd� Z d d � Z dd� Zd d� Zdd� Z dd� Zdd� Zd dd�Zd!dd�Zedd� �Zdd� Zdd� Z� ZS )"�DownloadCommandZdownloadz%Download package to current directoryc s t t| �j|� d | _d | _d S )N)�superr �__init__�opts�parser)�self�cli)� __class__� �/usr/lib/python3.6/download.pyr + s zDownloadCommand.__init__c C s� | j ddtd�d� | j ddtd�d� | j d dtd �d� | j ddtd�d� | j d ddg tjdtd�d� | j ddtd�d� | j ddtd�d� | j ddddtd�d� | j ddddd d!gg td"�d#� d S )$N�packages�+zpackages to download)�nargs�helpz--source� store_truezdownload the src.rpm instead)�actionr z--debuginfoz'download the -debuginfo package insteadz --debugsourcez)download the -debugsource package insteadz--archz --archlist�archesz[arch]z5limit the query to packages of given architectures.)�dest�defaultr �metavarr z --resolvez(resolve and download needed dependenciesz --alldepsz^when running with --resolve, download all dependencies (do not exclude already installed ones)z--urlz--urls�urlzJprint list of urls where the rpms can be downloaded instead of downloading)r r r z--urlprotocols�append�http�httpsZrsync�ftpz4when running with --url, limit to specific protocols)r �choicesr r )�add_argumentr r Z_SplitCallback)r r r r � set_argparser0 s* zDownloadCommand.set_argparserc C s� | j j}d|_d|_| jjr*| jjr*d|_| jjr>| j j j� | jjsN| jj rZ| j j j� | jjrr| jj| j j_ntjjtj� �| j j_d S )NTF)r �demandsZsack_activationZavailable_reposr �resolveZalldepsZload_system_repo�source�baseZreposZenable_source_repos� debuginfo�debugsourceZenable_debug_repos�destdir�conf�dnf�i18n�ucd�os�getcwd)r r# r r r � configureK s zDownloadCommand.configurec C s | j j r.| j j r.| j j r.| j| j j�}nXg }| j jrN|j| j| j j�� | j jrj|j| j| j j�� | j jr�|j| j | j j�� | j j r�xd|D ]\}|jtj kr�|j| j jd�}|r�t|� q�td�|j }| jjjr�tjj|��tj|� q�W dS | j|� dS )zExecute the util action here.)�schemesz$Failed to get mirror for package: %sN)r r% r'