3 ©ft`S ã @ s€ d dl mZ d dl mZ d dlZd dlmZ d dlZd dlZd dl m Z d dlmZ d dl mZ ejdƒZG d d „ d e jƒZdS )é )Úabsolute_import)Úunicode_literalsN)Úchain)Úcommands)ÚOptionParser)Ú_Údnfc @ s’ e Zd ZdZejejejdœZdZ de ejƒ ƒ Ze dƒZedd „ ƒZd d„ Zdd „ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )ÚInstallCommandzUA class containing methods needed by the cli to execute the install command. )z install-nz install-naz install-nevrazalternative-for({})ÚinstallÚlocalinstallÚinz,install a package or packages on your systemc C s" | j ddtdƒtjtdƒd� d S )NÚpackageú+ZPACKAGEzPackage to install)ÚnargsÚmetavarÚactionÚhelp)Úadd_argumentr r ZParseSpecGroupFileCallback)Úparser© r ú/usr/lib/python3.6/install.pyÚ set_argparser1 s zInstallCommand.set_argparserc C sH | j j}d|_d|_d|_d|_tj| j| j ƒ | j j sDtj| jƒ dS )zÄVerify that conditions are met so that this command can run. That there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. TN)ÚcliÚdemandsZsack_activationZavailable_reposZ resolvingZ root_userr Z_checkGPGKeyÚbaseÚoptsÚ filenamesZ_checkEnabledRepo)Úselfr r r r Ú configure7 s zInstallCommand.configurec C sP g }g }g }| j ƒ }| jj| jƒ | jjdkrf| jjs>| jjrf| j| jjƒ | jj j rftjj tdƒƒ‚g }| jjo|| jjdk�rTtjj�rLy,tjjj| jƒ}|j| jj| jj j d� W n’ tjjk �rH } zp|jrîx|jD ]}|j|ƒ qÜW |j�rx|jD ]}|jd| ƒ qþW |j} | �r8tjtjjj| d ƒƒ W Y d d }~X nX n| jj}| jj�r�|�r�| j| jjƒ | jj j �r˜tjj tdƒƒ‚n| jƒ }|�rÌ|�rÌ| j|ƒ | jj j �rêtjj tdƒƒ‚n|�rê| jjdk�rê| j|ƒ | jjdk�r| j |ƒ}t!|ƒdk�s$t!|ƒdk�s$|�rL| jj j �rLtjj"tdƒdj#|ƒ|d�‚d S ) Nr zNothing to do.)Ústrictú@r zUnable to find a matchú )Úpkg_specZpackages)$Ú_get_nevra_forms_from_commandr Z _populate_update_security_filterr ÚcommandÚ grp_specsÚ pkg_specsÚ_log_not_valid_rpm_file_pathsr Úconfr r Ú exceptionsÚErrorr ZWITH_MODULESÚmoduleÚmodule_baseZ ModuleBaser Z MarkingErrorsZno_match_group_specsÚappendZerror_group_specsÚmodule_depsolv_errorsÚloggerÚerrorZformat_modular_solver_errorsr Ú_inform_not_a_valid_combinationÚ_install_filesÚ_install_groupsÚ_install_packagesÚlenZPackagesNotAvailableErrorÚjoin) r Úerr_pkgsÚerrsZerror_module_specsÚnevra_formsZskipped_grp_specsr, ÚeZe_specr. r r r ÚrunE sX .zInstallCommand.runc C s&