404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.133.154.208: ~ $
3

�f�$�@s�ddlmZddlmZddlmZmZddlZddlZddlZddl	Zddl
ZddlZddlZ
ddlZddlZddlZddlZejjGdd�dejj��ZdS)�)�absolute_import)�unicode_literals)�_�loggerNcs�eZdZdZdZee�Zed�Z�fdd�Zdd�Z	d	d
�Z
edd��Zd
d�Z
dd�Zdd�Zedd��Zdd�Zdd�Zdd�Zdd�Z�ZS)�BuildDepCommand�builddep�	build-depz3Install build dependencies for package or spec filez[PACKAGE|PACKAGE.spec]cs(tt|�j|�tjjj�|_g|_dS)N)	�superr�__init__�dnf�rpmZtransactionZinitReadOnlyTransaction�_rpm_ts�tempdirs)�self�cli)�	__class__��/usr/lib/python3.6/builddep.pyr
/szBuildDepCommand.__init__cCsx|jD]}tj|�qWdS)N)r�shutilZrmtree)r�temp_dirrrr�__del__4szBuildDepCommand.__del__cCs�tjjj|�}|ddkr |jStjj�}tjdd�}t	jj
|t	jj|��}|jj
|�t|d�}zFy|j|jjj||j��Wn$tk
r�}z�WYdd}~XnXWd|j�X|S)	z�
        In case pkgspec is a remote URL, download it to a temporary location
        and use the temporary file instead.
        r�file�Z
dnf_builddep_)�prefixzwb+N)rr)rZpycompZurlparse�path�libdnfZrepoZ
Downloader�tempfileZmkdtemp�os�join�basenamer�append�openZdownloadURL�baseZconfZ_config�fileno�RuntimeError�close)r�pkgspec�locationZ
downloaderrZ	temp_fileZtemp_fo�exrrr�_download_remote_file8s


z%BuildDepCommand._download_remote_filec	Cs�dd�}|jdddtd�d�|jdd	d
gd|td�d
�|jdddtd�d�|j�}|jddtd�d�|jddtd�d�dS)NcSs:|r|jdd�ng}t|�dkr6td�|}tj|��|S)N��z&'%s' is not of the format 'MACRO EXPR')�split�lenr�argparseZArgumentTypeError)�argZarglist�msgrrr�	macro_defRs

z0BuildDepCommand.set_argparser.<locals>.macro_def�packages�+�packagez"packages with builddeps to install)�nargs�metavar�helpz-Dz--definer z'MACRO EXPR'z$define a macro for spec file parsing)�action�defaultr6�typer7z--skip-unavailable�
store_trueFz5skip build dependencies not available in repositories)r8r9r7z--specz)treat commandline arguments as spec files)r8r7z--srpmz)treat commandline arguments as source rpm)�add_argumentrZadd_mutually_exclusive_group)�parserr1Zptyperrr�
set_argparserPs

zBuildDepCommand.set_argparsercCs|jjsd|j_dS)N�error)�optsZrpmverbosity)rrrr�
pre_configurefszBuildDepCommand.pre_configurecCsr|jj}d|_d|_d|_d|_|jjp.|jjsnx<|jj	D]0}|j
d�pZ|j
d�pZ|j
d�s:|jjj
�Pq:WdS)NTz.src.rpmz
.nosrc.rpmz.spec)r�demandsZavailable_reposZ	resolvingZ	root_userZsack_activationr@�spec�srpmr2�endswithr"ZreposZenable_source_repos)rrBr&rrr�	configurejs


zBuildDepCommand.configurecCs\tjjj|j�}x$|jjD]}tj|d|d�qWd}x�|jj	D]�}|j
|�}yl|jjrh|j|�nT|jj
r||j|�n@|jd�s�|jd�r�|j|�n |jd�r�|j|�n
|j|�WqDtjjk
�r}z:x$|j�D]}tjtd�j|��q�Wtj|�d}WYdd}~XqDXqDWx |jjD]}tj|d��q*W|�rXtjjtd	���dS)
Nrr*Fz.src.rpmz	nosrc.rpmz.speczRPM: {}Tz!Some packages could not be found.)rZyumZrpmtransZRPMTransactionr"r@�definerZaddMacror2r)rD�	_src_depsrC�
_spec_depsrE�_remote_deps�
exceptions�ErrorZmessagesrr?r�formatZdelMacro)rZrpmlogZmacroZ
pkg_errorsr&�e�linerrr�runzs2


zBuildDepCommand.runcCs|j�dd�S)Nr+)ZDNEVR)Zrpm_deprrr�_rpm_dep2reldep_str�sz#BuildDepCommand._rpm_dep2reldep_strcCs�tjj|jj�}|j|d�|j�}|rX|jd�rXtjj|jj�}|j|d�|j�}|r�|jd�r�td�}t	j
||�|jjdkS|r�|jj
|�}|r�x|D]}tjj|�q�W|jjj|dd�dS)	N)Zprovides�/)r�(z$No matching package to install: '%s'TF)ZselectZoptional)rZselectorZSelectorr"�sack�setZmatches�
startswithrr�warningr@Zskip_unavailableZ_sltr_matches_installedZ_msg_installedZ_goalZinstall)r�
reldep_strZsltr�foundr0Zalready_instr4rrr�_install�s$
zBuildDepCommand._installc
Cs�tj|tj�}y|jj|�}WnRtjk
rp}z4t|�dkrJtd�|}tj	|�t
jj|��WYdd}~XnXtj	|�|j
d�}d}x0|D](}|j|�}|jd�r�q�||j|�M}q�W|s�td�}	t
jj|	��|jjr�tjtd��dS)Nzerror reading package headerz2Failed to open: '%s', not a valid source rpm file.ZrequirenameTzrpmlib(zNot all dependencies satisfiedzJWarning: -D or --define arguments have no meaning for source rpm packages.)rr!�O_RDONLYr
ZhdrFromFdnorr?�strrr%rrKrLZdsFromHeaderrQrVrZr@rGrrW)
rZsrc_fn�fd�hrN�ds�done�deprX�errrrrrH�s*





zBuildDepCommand._src_depsc	Cs�ytj|�}Wn>tk
rL}z"td�||f}tjj|��WYdd}~XnXd}x.tj|jd�D]}|j	|�}||j
|�M}qbW|s�td�}tjj|��dS)Nz/Failed to open: '%s', not a valid spec file: %sT�requireszNot all dependencies satisfied)rrC�
ValueErrorrrrKrLr_ZsourceHeaderrQrZ)	rZspec_fnrCr(r0r`rarXrbrrrrI�s

zBuildDepCommand._spec_depsc	Cs�tjj|�j|jj�jdd�}tdd�|D��}|jjj�j	�j||gdd�j
�j�}|sptjj
td�|��d}x.|D]&}x |jD]}||jt|��M}q�WqzW|s�td�}tjj
|��dS)	N�src)Z	arch__neqcSsh|]
}|j�qSr)Zsource_name)�.0�pkgrrr�	<setcomp>�sz/BuildDepCommand._remote_deps.<locals>.<setcomp>)�nameZarchzno package matched: %sTzNot all dependencies satisfied)rZsubjectZSubjectZget_best_queryr"rT�filter�listZquery�	availableZlatestrPrKrLrrcrZr\)	rr4rlZsourcenamesZpkgsr`rgZreqrbrrrrJ�s
zBuildDepCommand._remote_deps)rr)�__name__�
__module__�__qualname__�aliasesr0rZsummaryZusager
rr)�staticmethodr>rArFrPrQrZrHrIrJ�
__classcell__rr)rrr's !r)Z
__future__rrZdnfpluginscorerrr.rZdnf.cliZdnf.exceptionsZdnf.rpm.transactionZdnf.yum.rpmtransZlibdnf.reporrrrrZpluginZregister_commandrZCommandrrrrr�<module>s

Filemanager

Name Type Size Permission Actions
builddep.cpython-36.opt-1.pyc File 7.27 KB 0644
builddep.cpython-36.pyc File 7.27 KB 0644
changelog.cpython-36.opt-1.pyc File 4.08 KB 0644
changelog.cpython-36.pyc File 4.08 KB 0644
config_manager.cpython-36.opt-1.pyc File 7.09 KB 0644
config_manager.cpython-36.pyc File 7.09 KB 0644
copr.cpython-36.opt-1.pyc File 20.2 KB 0644
copr.cpython-36.pyc File 20.2 KB 0644
debug.cpython-36.opt-1.pyc File 10.56 KB 0644
debug.cpython-36.pyc File 10.56 KB 0644
debuginfo-install.cpython-36.opt-1.pyc File 5.93 KB 0644
debuginfo-install.cpython-36.pyc File 5.93 KB 0644
download.cpython-36.opt-1.pyc File 9.29 KB 0644
download.cpython-36.pyc File 9.29 KB 0644
generate_completion_cache.cpython-36.opt-1.pyc File 3 KB 0644
generate_completion_cache.cpython-36.pyc File 3 KB 0644
groups_manager.cpython-36.opt-1.pyc File 8.45 KB 0644
groups_manager.cpython-36.pyc File 8.45 KB 0644
needs_restarting.cpython-36.opt-1.pyc File 9.88 KB 0644
needs_restarting.cpython-36.pyc File 9.88 KB 0644
repoclosure.cpython-36.opt-1.pyc File 4.31 KB 0644
repoclosure.cpython-36.pyc File 4.31 KB 0644
repodiff.cpython-36.opt-1.pyc File 7.55 KB 0644
repodiff.cpython-36.pyc File 7.55 KB 0644
repograph.cpython-36.opt-1.pyc File 2.72 KB 0644
repograph.cpython-36.pyc File 2.72 KB 0644
repomanage.cpython-36.opt-1.pyc File 6.37 KB 0644
repomanage.cpython-36.pyc File 6.37 KB 0644
reposync.cpython-36.opt-1.pyc File 10.19 KB 0644
reposync.cpython-36.pyc File 10.19 KB 0644
spacewalk.cpython-36.opt-1.pyc File 9.79 KB 0644
spacewalk.cpython-36.pyc File 9.79 KB 0644
system_upgrade.cpython-36.opt-1.pyc File 22.48 KB 0644
system_upgrade.cpython-36.pyc File 22.48 KB 0644
universal_hooks.cpython-36.opt-1.pyc File 5.86 KB 0644
universal_hooks.cpython-36.pyc File 5.86 KB 0644