a º&cL+ ã @ sN d dl mZmZ d dlZd dlmZ G dd„ dejƒZG dd„ dejj ƒZ dS )é )Ú_ÚloggerN)ÚPackagec s, e Zd ZdZdZ‡ fdd„Zdd„ Z‡ ZS )ÚDebuginfoInstallz5DNF plugin supplying the 'debuginfo-install' command.údebuginfo-installc s4 t t| ƒ ||¡ || _|| _|dur0| t¡ dS )zInitialize the plugin instance.N)Úsuperr Ú__init__ÚbaseÚcliZregister_commandÚDebuginfoInstallCommand)Úselfr r ©Ú __class__© úA/usr/lib/python3.9/site-packages/dnf-plugins/debuginfo-install.pyr s zDebuginfoInstall.__init__c C sf | | jj¡}| d¡o.| dd¡o.| dd¡}|rbtj | j¡ ¡ j dd}t|ƒrb| jj ¡ d S )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)r Zcpr Zdbginfor r r Úconfig( s ÿ þzDebuginfoInstall.config)Ú__name__Ú __module__Ú__qualname__Ú__doc__Únamer r Ú __classcell__r r r r r s r c sh e Zd ZdZdZedƒZ‡ fdd„Zedd„ ƒZ dd „ Z d d„ Zdd „ Zdd„ Z dd„ Zdd„ Z‡ ZS )r z! DebuginfoInstall plugin for DNF )r zinstall debuginfo packagesc s4 t t| ƒ |¡ tƒ | _tƒ | _tƒ | _tƒ | _d S )N)r r r ÚsetÚavailable_debuginfo_missingÚavailable_debugsource_missingÚinstalled_debuginfo_missingÚinstalled_debugsource_missing)r r r r r r : s z DebuginfoInstallCommand.__init__c C s | j ddd d S )NÚpackageú+)Únargs)Úadd_argument)Úparserr r r Ú set_argparserB s z%DebuginfoInstallCommand.set_argparserc C s0 | j j}d|_d|_d|_d|_| jj ¡ d S )NT) r ÚdemandsZ resolvingZ root_userZsack_activationZavailable_reposr r r )r r- r r r Ú configureF s z!DebuginfoInstallCommand.configurec C sh g }t tjƒ}t tjƒ}| jjD ]„}tj |¡j | j jdd}|d }|stt tdƒ| j jj |¡¡ | |¡ q | ¡ ¡ }| | ¡ ¡ ¡ t| ¡ ƒD ]T}| tj¡rÊ|d | … |v rÊ| |¡ | tj¡rž|d | … |v rž| |¡ qž| ¡ D ]¦} | d } | jr i }| D ]}| |jg ¡ |¡ q| ¡ D ]^} | d }| |j |¡sz| |j!|¡sz| j" #t$|ƒ¡ | |j%|¡s>| j& #t$|ƒ¡ q>qü| j' tj¡sÀ| j' tj¡rÌ| (| ¡ qü|d d urF| )| j |d ¡s| )| j!|d ¡s| j* #d +| j'| j,¡¡ | )| j%|d ¡sü| j- #d +| j'| j,¡¡ qü| .| j | ¡s~| .| j!| ¡s~| j* #d +| j'| j,¡¡ | .| j%| ¡sü| j- #d +| j'| j,¡¡ qüq | j*rÌt tdƒd /t0| j*ƒ¡¡ | j-rðt td ƒd /t0| j-ƒ¡¡ | j"rt tdƒd /t0| j"ƒ¡¡ | j&r8t tdƒd /t0| j&ƒ¡¡ |rd| j j1j2rdtj3j4td ƒd /|¡d‚d S )NF)Zwith_srcr zNo match for argument: %sr Znevraz{}-{}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)5r r ZDEBUGINFO_SUFFIXZDEBUGSOURCE_SUFFIXZoptsr' r ZsubjectZSubjectZget_best_solutionr r r Ú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&