???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................3
ft`f                 @   sP  d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ dd
lmZ ddlZddlZddl	ZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZejdZdd Zdd Z eee
fddZ!dd Z"dd Z#dd Z$d ddZ%e&dkrLe%ej'dd dd dS )!z4
Entrance point for the yum command line interface.
    )print_function)absolute_import)unicode_literals)Conf)Cli)OptionParser)ucd)show_lock_owner)_Ndnfc             C   s&   t jtjjddd t jt|  dS )N T)exc_info   )loggerlogr   loggingSUBDEBUGcriticalr   )e r   /usr/lib/python3.6/main.py
ex_IOError2   s    r   c             C   s6   t jtjjddd | jd k	r2t jtdt|  dS )Nr   T)r   z	Error: %sr   )	r   r   r   r   r   valuer   r
   r   )r   r   r   r   ex_Error8   s    
r   c             C   s  y6t jj  t jjj| }t|| ||S Q R X W n t jjk
rr } ztj	|j
 t|j dS d }~X nL t jjk
r } ztj	|j
 dS d }~X n t jjk
r } zdS d }~X  n t jjk
 r } zt|S d }~X n tjk
r$ } ztj	tdt| dS d }~X n tjjk
r\ } ztj	tdt| dS d }~X nb tk
r } zt|S d }~X n> tk
r } z tj	djt|jtd dS d }~X nX d S )N   r   z	Error: %sz{}: {}zTerminated.)r   Zi18nZsetup_stdoutcliZBaseCli_main
exceptionsZProcessLockErrorr   r   r   r	   pid	LockErrorDepsolveErrorErrorr   hawkey	Exceptionr
   r   libdnferrorIOErrorr   KeyboardInterruptformattype__name__)argsZ
conf_class	cli_classZoption_parser_classbaser   r   r   r   main?   s4    

r.   c             C   sb   | j j  || }y|jttt||  W n( ttfk
rV } zt|S d}~X nX t	|| S )z2Run the dnf program from a command line interface.N)
Z_loggingZ	_presetupZ	configurelistmapr   r&   OSErrorr   cli_run)r-   r+   r,   Zoption_parserr   r   r   r   r   r   \   s    
r   c          ,   C   s  yt d}W nF tk
rR } z*|jtjkrBtjtd tjd W Y d d }~X n
X |j	  y| j
  W n@ tjjk
r    Y n( ttfk
r } zt|S d }~X nX | jjryt| |}W n tjjk
r } zt| d}| jj r|jjddr|tdjd7 }| jjjrN|s<|td	jd
7 }n|tdjd
7 }| jjjr| jjjd}|tjjkr|s|tdjd7 }n|tdjd7 }|rtjdj|  W Y d d }~X nX |r|S | jj   | jj!S )N.z8No read/execute access in current directory, moving to //r   T)Z	availablez?try to add '{}' to command line to replace conflicting packagesz--allowerasingz.try to add '{}' to skip uninstallable packagesz--skip-brokenz' or '{}' to skip uninstallable packagesbestz7try to add '{}' to use not only best candidate packagesz--nobestz0 or '{}' to use not only best candidate packagesz({}))"openr&   errnoZEACCESr   r   r
   oschdircloseZrunr   r   r   r1   r   demands	resolvingr    r   allow_erasingZ_goalZproblem_conflictsr(   r-   Zconfstrictr5   Z_get_priorityZPRIO_MAINCONFIGinfocommandZrun_transactionZsuccess_exit_status)r   r-   fr   retmsgZprior   r   r   r2   m   sT    







r2   c             C   s
  |j dkr&|j| jj tjtd | jj  g }| jj	dk	rN|j
| jj	 y|j|d W n tjjk
r } ztjt| dS d}~X nv tjjk
r } z$x| jj|D ]}tj| qW dS d}~X n4 tk
 r } zt|S d}~X nX tjtd dS )z9Perform the depsolve, download and RPM transaction stage.NzDependencies resolved.)Zdisplayr   z	Complete!r   )ZtransactionZresolver;   r=   r   r?   r
   r@   Zrun_resolvedZtransaction_displayappendZdo_transactionr   r   ZCliErrorr%   r   r   ZTransactionCheckErrorZget_error_outputr   r&   r   )r   r-   ZdisplaysexcerrrC   r   r   r   r   r<      s(    

r<   Fc             C   s   t | }|rtj| |S )ap  Call one of the multiple main() functions based on environment variables.

    :param args: command line arguments passed into yum
    :param exit_code: if *exit_code* is True, this function will exit
       python with its exit code when it has finished executing.
       Otherwise, it will return its exit code.
    :return: the exit code from dnf.yum execution
    )r.   sysexit)r+   	exit_codeZerrcoder   r   r   	user_main   s    

rJ   __main__r   T)rI   )F)(__doc__Z
__future__r   r   r   Zdnf.confr   Zdnf.cli.clir   Zdnf.cli.option_parserr   Zdnf.i18nr   Zdnf.cli.utilsr	   r
   Zdnf.clir   Zdnf.exceptionsZdnf.loggingZdnf.utilr7   r"   Zlibdnf.errorr$   r   r8   Zos.pathrG   Z	getLoggerr   r   r   r.   r   r2   r<   rJ   r*   argvr   r   r   r   <module>   sB   
5

