403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3.9/site-packages/dnf-plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.9/site-packages/dnf-plugins/__pycache__/builddep.cpython-39.pyc
a

�&c�$�@s�ddlmZddlmZddlmZmZddlZddlZddlZddl	Zddl
ZddlZddlZ
ddlZddlZddlZddlZejjGdd�dejj��ZdS)�)�absolute_import)�unicode_literals)�_�loggerNcs�eZdZdZdZee�Zed�Z�fdd�Zdd�Z	dd	�Z
ed
d��Zdd
�Z
dd�Zdd�Zedd��Zdd�Zdd�Zdd�Zdd�Z�ZS)�BuildDepCommand)Zbuilddepz	build-depz3Install build dependencies for package or spec filez[PACKAGE|PACKAGE.spec]cs(tt|��|�tjj��|_g|_dS�N)	�superr�__init__�dnf�rpmZtransactionZinitReadOnlyTransaction�_rpm_ts�tempdirs)�self�cli��	__class__��8/usr/lib/python3.9/site-packages/dnf-plugins/builddep.pyr	/szBuildDepCommand.__init__cCs|jD]}t�|�qdSr)r
�shutilZrmtree)r�temp_dirrrr�__del__4s
zBuildDepCommand.__del__c
Cs�tjj�|�}|ddvr |jStj��}tjdd�}t	j�
|t	j�|��}|j�
|�t|d�}zPz|�|jjj||���Wn&ty�}z�WYd}~n
d}~00W|��n
|��0|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)r
Zpycomp�urlparse�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�|��}|jddtd�d�|jddtd�d�dS)NcSs:|r|�dd�ng}t|�dkr6td�|}t�|��|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�defaultr7�typer8z--skip-unavailable�
store_trueFz5skip build dependencies not available in repositories)r9r:r8z--specz)treat commandline arguments as spec files)r9r8z--srpmz)treat commandline arguments as source rpm)�add_argumentrZadd_mutually_exclusive_group)�parserr2Zptyperrr�
set_argparserPs$
��
���zBuildDepCommand.set_argparsercCs|jjsd|j_dS)N�error)�optsZrpmverbosity)rrrr�
pre_configurefszBuildDepCommand.pre_configurecCsp|jj}d|_d|_d|_d|_|jjsl|jjsl|jj	D]2}|�
d�s8|�
d�s8|�
d�s8|jj�
�qlq8dS)NT�.src.rpmz
.nosrc.rpm�.spec)r�demandsZavailable_reposZ	resolvingZ	root_userZsack_activationrA�spec�srpmr3�endswithr#ZreposZenable_source_repos)rrEr'rrr�	configurejs
��zBuildDepCommand.configurecCsNtjj�|j�}|jjD]}t�|d|d�qd}|jj	D]�}|�
|�}zl|jjrb|�|�nT|jj
rv|�|�n@|�d�s�|�d�r�|�|�n |�d�r�|�|�n
|�|�Wq>tjj�y}z<|��D]}t�td��|��q�t�|�d}WYd}~q>d}~00q>|jjD]}t�|d��q|�rJtj�td	���dS)
Nrr+FrCz	nosrc.rpmrDzRPM: {}Tz!Some packages could not be found.)r
ZyumZrpmtransZRPMTransactionr#rA�definerZaddMacror3r*rG�	_src_depsrF�
_spec_depsrH�_remote_deps�
exceptions�ErrorZmessagesrr@r�formatZdelMacro)rZrpmlogZmacroZ
pkg_errorsr'�e�linerrr�runzs2


zBuildDepCommand.runcCs|��dd�S)Nr,)ZDNEVR)Zrpm_deprrr�_rpm_dep2reldep_str�sz#BuildDepCommand._rpm_dep2reldep_strcCs�tj�|jj�}|j|d�|��}|sV|�d�rVtj�|jj�}|j|d�|��}|s�|�d�s�td�}t	�
||�|jjduS|r�|j�
|�}|r�|D]}tj�|�q�|jjj|dd�dS)	N)Zprovides�/)r�(z$No matching package to install: '%s'TF)ZselectZoptional)r
�selectorZSelectorr#�sack�setZmatches�
startswithrr�warningrAZskip_unavailableZ_sltr_matches_installedZ_msg_installedZ_goalZinstall)r�
reldep_strZsltr�foundr1Zalready_instr5rrr�_install�s$zBuildDepCommand._installc

Cs�t�|tj�}z|j�|�}WnTtjyr}z:t|�dkrHtd�|}t�	|�t
j�|��WYd}~n
d}~00t�	|�|�
d�}d}|D](}|�|�}|�d�r�q�||�|�M}q�|s�td�}	t
j�|	��|jjr�t�td��dS)Nzerror reading package headerz2Failed to open: '%s', not a valid source rpm file.ZrequirenameTzrpmlib(�Not all dependencies satisfiedzJWarning: -D or --define arguments have no meaning for source rpm packages.)rr"�O_RDONLYrZhdrFromFdnorr@�strrr&r
rNrOZdsFromHeaderrTrZr^rArJrr[)
rZsrc_fn�fd�hrQ�ds�done�depr\�errrrrrK�s*
"



zBuildDepCommand._src_depsc	
Cs�zt�|�}Wn@tyN}z(td�||f}tj�|��WYd}~n
d}~00d}t�|jd�D]}|�	|�}||�
|�M}qb|s�td�}tj�|��dS)Nz/Failed to open: '%s', not a valid spec file: %sT�requiresr_)rrF�
ValueErrorrr
rNrOrdZsourceHeaderrTr^)	rZspec_fnrFr)r1rerfr\rgrrrrL�s�"
zBuildDepCommand._spec_depsc	Cs�tj�|��|jj�jdd�}tdd�|D��}|jj���	�j||gdd��
���}|sptj�
td�|��d}|D]"}|jD]}||�t|��M}q�qx|s�td�}tj�
|��dS)	N�src)Z	arch__neqcSsh|]
}|j�qSr)Zsource_name)�.0�pkgrrr�	<setcomp>��z/BuildDepCommand._remote_deps.<locals>.<setcomp>)�nameZarchzno package matched: %sTr_)r
ZsubjectZSubjectZget_best_queryr#rX�filter�list�query�	availableZlatestrSrNrOrrhr^ra)	rr5rsZsourcenamesZpkgsrerlZreqrgrrrrM�s$��
�
zBuildDepCommand._remote_deps)�__name__�
__module__�__qualname__�aliasesr1rZsummaryZusager	rr*�staticmethodr?rBrIrSrTr^rKrLrM�
__classcell__rrrrr's$
!
r)Z
__future__rrZdnfpluginscorerrr/r
Zdnf.cliZdnf.exceptionsZdnf.rpm.transactionZdnf.yum.rpmtransZlibdnf.reporrrrrZpluginZregister_commandrZCommandrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit