Viewing File: /usr/lib/python3.6/site-packages/dnf-plugins/__pycache__/debuginfo-install.cpython-36.opt-1.pyc

3

�gt`L+�@sNddlmZmZddlZddlmZGdd�dej�ZGdd�dejj	�Z
dS)�)�_�loggerN)�Packagecs,eZdZdZdZ�fdd�Zdd�Z�ZS)�DebuginfoInstallz5DNF plugin supplying the 'debuginfo-install' command.zdebuginfo-installcs4tt|�j||�||_||_|dk	r0|jt�dS)zInitialize the plugin instance.N)�superr�__init__�base�cliZregister_command�DebuginfoInstallCommand)�selfrr	)�	__class__��'/usr/lib/python3.6/debuginfo-install.pyr s
zDebuginfoInstall.__init__cCsf|j|jj�}|jd�o.|jdd�o.|jdd�}|rbtjj|j�j	�j
dd�}t|�rb|jjj
�dS)N�main�
autoupdatez*-debuginfo)Z
name__glob)Zread_configr�confZhas_sectionZ
has_optionZ
getboolean�dnf�sackZ_rpmdb_sack�query�filterm�len�repos�enable_debug_repos)rZcprZdbginfor
r
r�config(s
zDebuginfoInstall.config)�__name__�
__module__�__qualname__�__doc__�namerr�
__classcell__r
r
)rrrsrcsheZdZdZdZed�Z�fdd�Zedd��Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Z�ZS)r
z! DebuginfoInstall plugin for DNF �debuginfo-installzinstall debuginfo packagescs4tt|�j|�t�|_t�|_t�|_t�|_dS)N)rr
r�set�available_debuginfo_missing�available_debugsource_missing�installed_debuginfo_missing�installed_debugsource_missing)rr	)rr
rr:s
z DebuginfoInstallCommand.__init__cCs|jddd�dS)N�package�+)�nargs)�add_argument)�parserr
r
r�
set_argparserBsz%DebuginfoInstallCommand.set_argparsercCs0|jj}d|_d|_d|_d|_|jjj�dS)NT)	r	�demandsZ	resolvingZ	root_userZsack_activationZavailable_reposrrr)rr,r
r
r�	configureFsz!DebuginfoInstallCommand.configurecCs�g}ttj�}ttj�}�x�|jjD�]�}tjj|�j	|j
jdd�}|d}|sxtj
td�|j
jjj|��|j|�q$|j�j�}|j|j�j��xdt|j��D]T}|jtj�r�|d|�|kr�|j|�|jtj�r�|d|�|kr�|j|�q�W�x�|j�D�]�}	|	d}
|
j�r�i}x"|	D]}|j|jg�j|��q(Wxj|j�D]^}
|
d}|j|j |��s�|j|j!|��s�|j"j#t$|��|j|j%|��sP|j&j#t$|���qPW�q|
j'jtj��s�|
j'jtj��r�|j(|	��q|ddk	�rb|j)|
j |d��s2|j)|
j!|d��s2|j*j#dj+|
j'|
j,��|j)|
j%|d��s|j-j#dj+|
j'|
j,���q|j.|
j |	��s�|j.|
j!|	��s�|j*j#dj+|
j'|
j,��|j.|
j%|	��s|j-j#dj+|
j'|
j,���qWq$W|j*�r�tj
td�d	j/t0|j*���|j-�rtj
td
�d	j/t0|j-���|j"�r8tj
td�d	j/t0|j"���|j&�r\tj
td�d	j/t0|j&���|�r�|j
j1j2�r�tj3j4td
�dj/|�d��dS)NF)Zwith_srcrzNo match for argument: %srZnevraz{}-{}zICould not find debuginfo package for the following available packages: %sz, zKCould not find debugsource package for the following available packages: %szICould not find debuginfo package for the following installed packages: %szKCould not find debugsource package for the following installed packages: %szUnable to find a match� )Zpkg_spec)5rrZDEBUGINFO_SUFFIXZDEBUGSOURCE_SUFFIXZoptsr&rZsubjectZSubjectZget_best_solutionrrr�infor�outputZtermZbold�appendZ	availableZ
_name_dict�updateZ	installed�list�keys�endswith�pop�valuesZ_from_system�
setdefault�arch�_install_debug_from_system�
debug_nameZsource_debug_namer$�add�strZdebugsource_namer%r�_install�_install_debugr"�format�evrr#�_install_debug_no_nevra�join�sortedr�strict�
exceptionsZPackagesNotAvailableError)rZerrors_specZdebuginfo_suffix_lenZdebugsource_suffix_lenZpkgspecZsolutionrZpackage_dictr�pkgsZ	first_pkgZ	arch_dict�pkgZpackage_arch_listr
r
r�runNs�





zDebuginfoInstallCommand.runcCs:|jjj�j||j|j|j|jd�}|r6|j|�dSdS)N)r�epoch�version�releaser9TF)	rrr�filterrJrKrLr9r>)rr;rHrr
r
rr:�s

z2DebuginfoInstallCommand._install_debug_from_systemcCs�i}|jdk	r|j|d<|jdk	r,|j|d<|jdk	r@|j|d<|jdk	rT|j|d<|jjj�jfd|i|��}|r�|j|�dSdS)NZepoch__globZ
version__globZ
release__globZ
arch__globrTF)	rJrKrLr9rrrrMr>)rr;Z
base_nevra�kwargsrr
r
rr?�s








z&DebuginfoInstallCommand._install_debugcs8|jjj�j�fdd�|D�d�}|r4|j|�dSdS)Ncsg|]}dj�|j|j��qS)z{}-{}.{})r@rAr9)�.0�p)r;r
r�
<listcomp>�szCDebuginfoInstallCommand._install_debug_no_nevra.<locals>.<listcomp>)Znevra_strictTF)rrrrr>)rr;rGrr
)r;rrB�s
z/DebuginfoInstallCommand._install_debug_no_nevracCs:tjj|jj�}|j|d�|jjj||jjj	d�dS)N)rH)ZselectZoptional)
r�selectorZSelectorrrr!ZgoalZinstallrrE)rrGrRr
r
rr>�sz DebuginfoInstallCommand._install)r )rrrr�aliasesrZsummaryr�staticmethodr+r-rIr:r?rBr>rr
r
)rrr
4s|
	r
)ZdnfpluginscorerrrZdnf.packagerZPluginrr	ZCommandr
r
r
r
r�<module>s
Back to Directory File Manager
<