MINI MINI MANI MO

Path : /usr/lib/python2.7/site-packages/yum/
File Upload :
Current File : //usr/lib/python2.7/site-packages/yum/depsolve.pyc


[c@srdZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlZddlmZm
Z
ddlmZddlZddlmZddlmZddlTddlZddlZddlZejd	ejdd
lmZddlmZmZye dd
d
ks;t!WndZ"dZ nXiej#d6ej$ej#Bd6ej%d6ej%ej$Bd6ej$d6de&6Z'iZ(xe'D]Z)e)e(e'e)<qWdfdYZ*dfdYZ+dfdYZ,dfdYZ-de.fdYZ/d e.fd!YZ0d"e.fd#YZ1d$e.fd%YZ2dS(&s'
Dependency resolution module for yum.
iN(tarchDifferencetcanCoinstall(tuniquetversion_tuple_to_string(tTransactionMember(tListPackageSack(t
PackageEVR(t*tignore(tproxy(t_t_rpm_ver_atleastiicGs*x#|D]}||kr|}qqW|S(N((txtargsty((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytmin1s

cGs*x#|D]}||kr|}qqW|S(N((RR
R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytmax5s

tGTtGEtLTtLEtEQit_wrap_ayum_getPkgSackcBs eZdZdZdZRS(s This is a wrapper for calling YumBase.pkgSack because
        otherwise we take a real reference through the bound method and
        that is d00m (this applies to YumBase and TransactionInfo, hence why
        we have a separate class). cCst||_dS(N(tweakreftayum(tselfR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt__init__IscCs
|jjS(N(RtpkgSack(R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt__call__Ks(t__name__t
__module__t__doc__RR(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRDs	t_wrap_ayum_installcBs eZdZdZdZRS(s This is a wrapper for calling YumBase.install because
        otherwise we take a real reference through the bound method and
        that is d00m (this applies to YumBase and TransactionInfo, hence why
        we have a separate class). cCst||_dS(N(RR(RR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRSscOs|jj||S(N(Rtinstall(RR
tkwargs((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRUs(RRRRR(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR Ns	t_wrap_ayum_removecBs eZdZdZdZRS(s This is a wrapper for calling YumBase.remove because
        otherwise we take a real reference through the bound method and
        that is d00m (this applies to YumBase and TransactionInfo, hence why
        we have a separate class). cCst||_dS(N(RR(RR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR\scOs|jj||S(N(Rtremove(RR
R"((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR^s(RRRRR(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR#Ws	t_wrap_ayum_updatecBs eZdZdZdZRS(s This is a wrapper for calling YumBase.update because
        otherwise we take a real reference through the bound method and
        that is d00m (this applies to YumBase and TransactionInfo, hence why
        we have a separate class). cCst||_dS(N(RR(RR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRescOs|jj||S(N(Rtupdate(RR
R"((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRgs(RRRRR(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR%`s	tDepsolvecBsgeZdZdZdZedZedZdZdZ	dZ
dZd	Zd
Z
ddd
ZdZdZedZdZdZdZdZdZdZdZdZdZdZeedZdZedZ dZ!dZ"d Z#d!Z$d"Z%d#Z&e&Z'd%d$Z)RS(&s#A class for resolving dependencies.cCsyd|_d|_d|_t|_tjd|_tjd|_	g|_
g|_d|_d|_
t|_dS(Nsyum.Depsolvesyum.verbose.Depsolve(tNonet_tst_tsInfot
dsCallbacktFalsetuse_txmbr_in_callbacktloggingt	getLoggertloggertverbose_loggertpathtloopstinstalledFileRequirestinstalledUnresolvedFileRequirest_missing_requires(R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRms								cCs)tjtdtjdd|jS(s.Sets up the transaction set before it is used.s5doTsSetup() will go away in a future version of Yum.
t
stackleveli(twarningstwarnR
tErrorstYumFutureDeprecationWarningt_getTs(R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt	doTsSetup}scCs|jdkrc|jdkrc|r_|jjdkr_t|}|jj|jd|ndS|jjst	j
tdn|j||j
dS(ssetup all the transaction set storage items we'll need
           This can't happen in __init__ b/c we don't know our installroot
           yetNs4Setting up TransactionSets before config class is up(R*R(R)RRtsetDatabasestrpmdbtconftinstallrootR:tYumBaseErrorR
t
_getTsInfotinitActionTs(Rtremove_onlytpkgSackCtor((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR<s
cCs|jdkr|j|_|r3d}d}nd}t|}|jj|j|||jj|j_t||j_	t
||j_t||j_
n|jS(s remove_only param. says if we are going to do _only_ remove(s) in
            the transaction. If so we don't need to setup the remote repos. N(R*R(t_transactionDataFactoryRR>R?R@tinstallonlypkgsR tinstall_methodR%t
update_methodR#t
remove_method(RRERRF((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRCs	cCs
||_dS(N(R*(Rtvalue((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt
_setTsInfoscCs
d|_dS(N(R(R*(R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt
_delTsInfoscCs|js|jn|jS(N(R)RD(R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_getActionTss	
cCst|jjr5tjd}tjd|jjntjj|jj|_itj	d6tj
d6tjd6tjd6tj
d6tjd6}ttd	rtj|d
<n|jjdxP|jjD]B}||kr|jj||q|jjtd|qW|jjs9|jtjtjnd}x|jjD]}||O}qLW|jj|d
S(s>Set up the transaction set that will be used for all the work.s%_install_langss%define _install_langs t	noscriptst
notriggerstnodocsttesttjustdbt	repackagetRPMTRANS_FLAG_NOCONTEXTSt
nocontextsis!Invalid tsflag in config file: %sN(R@toverride_install_langstrpmtexpandMacrotrpmUtilsttransactiontTransactionWrapperRAR)tRPMTRANS_FLAG_NOSCRIPTStRPMTRANS_FLAG_NOTRIGGERStRPMTRANS_FLAG_NODOCStRPMTRANS_FLAG_TESTtRPMTRANS_FLAG_JUSTDBtRPMTRANS_FLAG_REPACKAGEthasattrRVtsetFlagsttsflagst	addTsFlagR0tcriticalR
tdiskspacecheckt_add_prob_flagstRPMPROB_FILTER_DISKSPACEtRPMPROB_FILTER_DISKNODESttsInfotprobFilterFlagst
setProbFilter(Rtold_install_langstts_flags_to_rpmtflagt
probfilter((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRDs2	






cCsD|jjtjtd|t|jj|||f}|S(sSearch the packageSacks for what provides the specified
        feature or file.
      
        :param name: a string specifying the file or feature to search
           for
        :param flags: flags related to the search
        :param version: the version to search for
        :return: a :class:`ListPackagaSack` containing the packages
           that match the arguments, and may be empty
        sSearching pkgSack for dep: %s(R1tlogt
logginglevelstDEBUG_1R
RRtsearchProvides(RtnametflagstversiontdefSack((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytwhatProvidess!cCsMt|jj}|j|kr%tSx!|jD]}||kr/tSq/WtS(sReturn whether the given package object can be installed
        multiple times with different versions.  For example, this
        would be true of kernels and kernel modules.

        :param po: the package object that this function will
           determine whether can be install multiple times
        :return: a boolean specifying whether *po* can be installed
           multiple times
        (tsetR@RHRxtTruetprovides_namesR,(Rtpotiopkgstprov((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytallowedMultipleInstallss
iic
CsG|jr|jjni}|jjdkr>|jn|rx|jD]}|j}|dkrud}n|j|j||j|j	f}|j
dkrd}n|j
dkrd}nd|||f<qNWnxQ|jjD]@}|j
jtjtd||jd
kr|jdf|krNqn|jj}	tjj|	r|jj}
n|j|j|jj}
|jdkr|j|jr|j
jtjtd|jd|_t|_qn|j r
|}n|
|	f}|jj!|
||j|j
jtj"td	|j|j|jr?|j}|dkr|j#rd
}n|jj$|j|q?q|jdkr|j|jf|krqn|jj%|jj&|jr|j'rqn|jj$|jdn|j
jtj"td|jqqWdS(sxPopulate the transaction set.

        :param test: unused
        :param keepold: whether to keep old packages
        t0itiites
Member: %stus%s converted to installsAdding Package %s in mode %stdsRemoving Package %sN(RR(R((R+ttransactionPopulationttsR(RDtEtNtAtVtRtTypeRmt
getMembersR1RtRutDEBUG_3R
tts_statetpkgtupRtlocalPkgtosR2texiststreturnHeaderFromPackagetdownloadHeadertreturnLocalHeaderRtDEBUG_2t
TS_INSTALLtoutput_stateR-t
addInstallRvt
downgradestpkgAddedtaddErasetidxt
downgraded_by(
RRStkeepoldtts_elemttetepochtpkginfotmodettxmbrtrpmfilethdrtcbkeyt
dscb_ts_state((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt
populateTssj	
	-										cCsO|js
dSt|jdr5|jj||n|jj|j|dS(sW Call the callback for processing requires, call the nicest one
            available. Nt	procReqPo(R+RdRtprocReqRx(RRtniceformatneed((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt
_dscb_procReqEs
	cCs+g}|\}}}tjj|||}|jjtjtd|||j||yx|j	j
dkr|j|||\}}	n|j|||\}}	|	r|j
j||j|dfnWnDtjk
r}
|j
j||jt|
fd}d}	nX||	|fS(sprocesses a Requires dep from the resolveDeps functions, returns a tuple
           of (CheckDeps, missingdep, conflicts, errors) the last item is an array
           of error messagess%s requires: %st	installediii(R[t	miscutilst
formatRequireR1RtRuRvR
Rtrepotidt_requiringFromTransactiont_requiringFromInstalledtpo_with_problemstaddt_working_poR:tDepErrortstr(RRtrequirementt	errormsgstneednameRytneedversionRt	CheckDepst
missingdepR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_processReqPs "'"
cCs|t|t|fS(N(RyR(trntrftrv((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_prco_req_nfv2reqsscCs|j|d|d|dS(Niii(R(Rtreq((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt
_prco_req2reqwscCst|_t|jdrR|jj||}|dk	rR|jj||Sn|\}}}tjj|||}t	d||fS(Ntformat_missing_requiress%s requires %s(
R~R6RdR+RR(R[RRR
(RtreqPotreqTuptmsgRt	needflagsRtui_req((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_err_missing_requireszs		c%sd}d}|jjjtr.||fSj\}}}}	}
\}}}
tjj||
|}d#}d#}g}|||
f|jkr|j	j
tjt
d|j|||
f}|g}n|jjd|r#|jjd|}xX|D]}|j|jqWn7|j	j
tjt
d||jj|||
}x|D]}||_d|j}|j\}}}}}|j	j
tjt
d||jjd|d|d|d	|d
|}|d#kr||jjkr|jjd|d|}n|d#krS||jjkrS|jjd|}n|d#krtd|jj|||||rd}qn|d#k	ra|}||j|||
f<|j	j
tjt
d
|||PqaqaW|j	j
tjt
d|||d$kr|j	j
tjt
d|jj}d|j_|jdd}||j_tfd}||s|jdd}||dts|j}|j	j
tjt
d|j|Snd}n|d%kr]|j	j
tjt
d|jdd}t} |s|j}|j	j
tjt
d|n||tjj|
f}!xE|D]=}|j t!kr|jj"d|!rt} Pqt} qqW|r;| r;|j}|j	j
tjt
d|n| sT|j|Sd}n|d&kr|j	j
tjt
d||j#d}x|D]}|j$d|qWd}n|d'kr|jd|d|d|	d|
d}"|jjjt}|"r|r|dj t%krd|j	j
tjt
d |dj&dny|j	j
tjt
d!xW|dj'D]H}#t(|j)|#j*dkrt||j|#|dfSqWt}||fS|j	j
tjt
d"||j|S|d#kr||	|
d#f}$|j+d#kr_|j|S|j}|j	j
tj|d}d}|j|n||fS((sbprocesses the dependency resolution for a dep where the requiring 
           package is installedis3Needed Require has already been looked up, cheatingRxs4Needed Require is not a package name. Looking up: %ss%s.%s %s:%s-%ssPotential Provider: %starchRtvertrelcSs|jS(N(tobsoleted_by(R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt<lambda>sRs!Mode is %s for provider of %s: %ssMode for pkg providing %s: %studs"Trying to update %s to resolve depRtrequiringPocstxm|D]e}|s%|jjkr\}}}|t|tjj|f}||jjkrltSqqWtS(N(	Rxt_rflagsR[RtstringToVersionRtrequiresR~R,(ttxmbrstobsRtntftvtcreq(RR(s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_check_update_workeds

Rs&No update paths found for %s. Failure!itods=No update paths found for %s. Failure due to requirement: %s!Rs+Update for %s. Doesn't fix requirement: %s!Rs/TSINFO: %s package requiring %s marked as eraseRRztreleases-TSINFO: Obsoleting %s with %s to resolve dep.s#TSINFO: Updating %s to resolve dep.s*Cannot find an update path for dep for: %sN(R(R(R(RR(,RmtgetMembersWithStateRtTS_REMOVE_STATESR[RRR(t
cheaterlookupR1RtRuRR
R?tcontainst
matchNaevrtappendRtgetProvidesRtgetModeR@t
exactarchlisttfiltert	obsoletesR&R,R~RRRRtTS_INSTALL_STATESt	checkPrcoR$tsetAsDeptTS_OBSOLETEDRt
updated_bytmapRt
returnPrcoR(%RRRt	errorlistt	checkdepsRRxRRRRRRRRtneedmodetneedpot	providerst
cheater_poRRtinst_potinst_strti_nti_ati_eti_vti_rtthismodetorigobsRRtfixedt
req_lookupt
newupdatestpkgtreqpkg((RRs0/usr/lib/python2.7/site-packages/yum/depsolve.pyRs


	
	!

	%


%	

	!	!%
cCs|jdkrtS|dkr(d}nt|tjtjtjfkrjtj	j
|\}}}n0t|tjtjfkr|\}}}n|j}|j
d|||||ffr|jjtd||tStS(Nitprovidess"Quick matched %s to require for %s(t	_last_reqR(R,ttypettypest
StringTypetNoneTypetUnicodeTypeR[RRt	TupleTypetListTypeRR1tdebugR
R~(RRxRyRztr_etr_vtr_rR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_quickWhatProvides8s	$	$c%Cs|j\}}}}}|\}	}
}d}d}
i}|j|	|
|rX||
fS|j|	|
|}x|jD]}|jjd|r|jjtj	t
d||j|qzng}|j|sz|j
jd|j}x|D]}t|j|jjs|jj|rdt
d|}|jjtj	||j|qq|jj|r|j|jgj|jqqqW|jjd|j}xo|D]d}|j|rt|j|jrt
d|}|jjtj	||j|qqqWqzqzWt|dkrnd}
|j||}|j|||
fSx|jD]}|j\}}}}}|j
jd|d|d	|d
|d|}|dkr{|jjtj	t
d|||_||
fSq{Wg}x|jD]}|jd|d|jd	|jd|jd|j }|j!|x6|D].}||jkrkt"}||_||
fSqkWqW|j}t|dkr|d} n&|j#||d|	}!|!dd} |jjd| r<d}
d}|j||}|j|||
fS|jjd| jd| j}"t|"dkr|jj$t
d| |f|j
j%| |"d}|j&d|d|"dj'kr|"dj'j(|_(n	d|_(t"}| |_n|jj$t
d| |t)j*|	t+|
|}#|j,| d|#}$x_|$D]W}|j&d|d|_(|j|_|j|krQt-|j
j.||jqQqQW|$sd}
d}|j||}|j|nd}||
fS(skprocesses the dependency resolution for a dep where requiring 
           package is in the transaction setiRsB%s is in providing packages but it is already installed, removing.Rxs8Potential resolving package %s has newer instance in ts.s<Potential resolving package %s has newer instance installed.iRRRRRRs#%s already in ts, skipping this oneRRzRs#TSINFO: Marking %s as update for %streasontdeps$TSINFO: Marking %s as install for %stprovides_for(RR(/RRR|treturnPackagesR?RR1RtRuRR
t
delPackageRRmRRxRRRtverGTtverLTt
setdefaultRtsearchNevratlenRRRtreturnNewestByNameR&RRzRtextendR~t_compare_providersRt	addUpdateRt
yumdb_infoRtmisctstring_to_prco_tupleRR!RR$(%RRRRRxRRRzRRRRRRtupgradedtprovSackRttspkgsttspkgRtdbpkgstdbpkgRtaRRtrtpkgmodetresultsttresultsRtpkgstbestt
pkgresultstinsttreqtupleR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRJs



)
%


-		

	


!	
	!cCsO|js
dSt|jdr5|jj||n|jj|j|dS(sW Call the callback for processing requires, call the nicest one
            available. NtprocConflictPo(R+RdR<tprocConflictRx(RRR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_dscb_procConflicts
	cCs*t}g}|\}}}|j\}	}
}}}
tjj|||}|j||t|j}|tj	@r|j
d|j|jj|jt
}t|j|kr'|r'||fSn]|tj@r'|j
d|	|jj|jt
}t|j|kr'|r'||fSn|j
d|j|jj|jt
}t|j|krw|rw||fS|j
d|	|jj|jt
}t|j|kr|r||fSd|	t|f}|j||jjtj|t}|jj|||df||fS(s6processes a Conflict dep from the resolveDeps() methodRxs%s conflicts with %si(R~RR[RRR>R$RmRYt
RPMSENSE_LESSR&RxRRtRPMSENSE_GREATERRRR1RtRuRvR,RR(RRtconflicttconflicting_poRRRRyRRxRRRRRtlengthRR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_processConflicts>






cCs7x0|jD]%}|jr
|jj|jq
q
WdS(N(RmtisDepR$R(RR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_undoDepInstalls&s	cCsd}ddl}ddl}|j|}|j|j}|jdGH|jj|}|j|j	dd|j
d|S(s
Call :func:`resolveDeps`, and profile the call using the
        hotshot profiler.

        :return: a tuple containing the result code and a list of
           result strings.  This is simply the return value of
           :func:`resolveDeps` being passed up.
        sanaconda.prof.0iNsdone running depcheckttimetcallsi(thotshott
hotshot.statstProfiletruncalltresolveDepstclosetstatstloadt
strip_dirst
sort_statstprint_stats(RtfnRItproftrcRO((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytprof_resolveDeps,s


cCsddl}ddl}|j}|j|j}|jddGH|jd}|j|jd|j	d|S(sCall :func:`resolveDeps`, and profile the call using the
        cprof profiler.

        :return: a tuple containing the result code and a list of
           result strings.  This is simply the return value of
           :func:`resolveDeps` being passed up.
        iNtyumprofsdone running depcheckRGi(
tcProfiletpstatsRKRLRMt
dump_statstStatsRQRRRS(RRYRZRURVtp((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytcprof_resolveDeps@s



cCst|js"dtdgfSt|_d|_d|_|jjdt	t
}|}|}d}g}|jr|jjnd}x#t
r||j
jpdkrdtdgt|fS|d7}t
}x[|r;i|_|jr	|jjn|j|\}}	}
}||	O}||
O}qWd|_|rt	}xI|jD];\}}
|j||
\}}}||O}||7}q^W|r|jr|jjn|jjtjtdqqnd|_|rt	}xG|jD]9}|j|\}}||O}||7}|rPqqWt
rm|jrmt
}t
}d|_qmn|r|jr|jjn|jjtjtdqqnPqWxo|jjD]^}|j|jr|j dkr|jjtj!td	|jd
|_ t"|_#qqW|jrn|j
j$sM|jj%qn|rn|rn|jj%qnn|jjtjtdt	|j_&t|dkr^t|}t}x|jD]\}}}||f|krqn|j'||f|jjtj(d||j)f|j*d
d}|jjtj(d|qWd|fSt|jsdtdgfSdtdgfS(s1Resolve dependencies for the packages in the current
        trasaction set.
        
        :param full_check: whether to also check removes and installs,
           as well as dependencies
        :param skipping_broken: if this is true, a message saying that
           dependency solving has finished successfully will not be output.
           This is useful since if there are broken packages that are
           being skipped, :func:`resolveDeps` will need to be called
           multiple times before dependency solving is completely finished
        isSuccess - empty transactionthardiisDepsolving loop limit reached.sRestarting LoopRs%s converted to installRsDependency Process endings.SKIPBROKEN: %s from %s has depsolving problemss
s
  --> sSKIPBROKEN:  --> %sisSuccess - deps resolvedN(+R$RmR
R}RR(RRt
resetResolvedR,R~R+tstartR@tdepsolve_loop_limitRRttscheckt_resolveRequirest_checkFileRequiresRtrestartLoopR1RtRuRvt_checkConflictsRDt_checkObsoletesRRRRRRRtskip_brokentendtchangedRtDEBUG_4trepoidtreplace(Rt
full_checktskipping_brokenRtCheckRemovest
CheckInstallsRterrorstdepsolve_loop_countt
checkinstallstcheckremovestmissingRRtcheckdepRRARtdonetwpoterr((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRMTs				
			
	
			

			
			
c
Csit}t}t}t}x>|jjD]-}|jr|jr|j}|jr[d}n|dkry|jryd}n|dkr|jtkrd}q|j	sd}qn|jj
|j|n|jj
tjtd|f|j	r|jr|jdd|_n|j|_|jtk|jjdkkr]|j|}t}n|j|}t}t}	x|D]\}
}|jr|j|
|}|jj
tj||j||jj|
|j|dfd	}	qn|j|
|\}
}}||
O}||7}|	|O}	qW|	sK|jj |n||	O}q(W||||fS(
NRRR3toRsChecking deps for %siii(!R,RmtgetUnresolvedMembersR+RRt	reinstallRt
TS_OBSOLETINGtupdatesRRR1RtRuRR
t	relatedtoRRRtstateR(t
_checkInstallR~t_checkRemoveRRRRRRtmarkAsResolved(RRstany_missingRRrRqRRt	thisneedstmissing_in_pkgRRRRxRwR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRdsX						!		
 

cCsidd6dd6dd6dd6d	d
6dd6}|j|dd}d
}|d
jdr|d
jds|d
jdrd}n||fS(s8 Get a sort key for a package requires from most "narrow" to least,
            this tries to ensure that if we have two reqs like
            "libfoo = 1.2.3-4" and "foo-api" (which is also provided by
            libxyz-foo) that we'll get just libfoo.
            There are other similar cases this "handles".iRiRiRiRiRici
itlibs()s	()(64bit)N(R(tgett
startswithtendswith(Rtmappert	flagscoret	namescore((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt
_sort_req_key
s0
&	c
Cs|jjd}g}|jjsQx*|jD]}|j|jdq.Wnt|}g}x&t|d|jD]}|dj	drqyn||krqyn|j
jtj
td|||jj|}|r |jjd|r |j|j|j|fqynxe|D]]}|j|jkrEq'nx<|jjd|jd	tD]}	|	j|jd
tqdWq'WqyW|S(NRtstrong_requirestkeyisrpmlib(s%looking for %s as a requirement of %sR
Rt
output_statestrelonly(RRR@trecheck_installed_requiresRR&R}tsortedRRR1RtRuRR
RmRtinPrcoRangeRRRxRRRRR~(
RRt
txmbr_reqstoldreqstoldpotretRtprovsRtmember((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR*s0"
"cCsA|j}|jd}i}x6|j|jD]$}x|jD]}d||<q?Wq/Wg}x|D]}|djdrqdn||krqdnx|jj|jD]\}	}
|j	j
rW|jrW|jt
krW|j}|rt|dr|j|j|
n.|r@t|dr@|j|j|	|
n|jj|jgS|j	jr|jr|jt
kr|j}|rt|dr|j|	|
n.|rt|dr|j|j|	|
n|jj|jgS|j	jrZ|jt
krZ|j}|rCt|drC|j|j|	|
n|jj|jgSx|
D]}t}
x-|jD]"}|jd|rwt}
PqwqwW|
rqanx-|jD]"}|jd|rt}
PqqW|
rqan|\}}}|jj|||sa|j|	|j|||fqaqaWqWqdW|S(NR
iisrpmlib(trepoPkgRemoveReqt	removeReqtgroupRemoveReq(RRRRR
RRmtgetRequirest	iteritemsR@trepopkgsremove_leaf_onlytrepopkgRtTS_ERASER+RdRRR$Rtgroupremove_leaf_onlytgroupsRtremove_leaf_onlyR,RR~RRR(RRRRt
newpoprovstnewpoR]RRRthitstcbthittfoundRRR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRRsp	
%			
1c
Cst}t}i}g}|jdkrQ|jj\|_|_|_ng}x||jjD]k\}}|jj	|dt
r|j|qg|j|x'|D]}|j
|gj|qWqgWx|D]}|j|=qW||j8}x|jj	dtD]}	g}x|	jjD]\}
}}|
jdr-|j|
|
|jkrt}
x6|	jD]+}|jd|
ddfrwt}
PqwqwW|
rq-qn|
|kr|j|
n|j|
|j
|
gj|	jjq-q-W||j|	jj<qWg}x|jD]u}g}x@|j|D]1}|jj	|dt
riqEn|j|qEW|s|j|q+n||j|<q+Wx|D]}|j|=qW|j}x|D]}||jkrqn|jj|}|r7|j
|gjg|D]}|j^qqn|jj|}|r|j
|gjg|D]}|j^qhqn|tjj|krtjj|}|jj|}|r|j
|gjg|D]}|j^qqqnxh||D]\}|jj	|t}|r:|dj}n|j|}|j||ddffq	WqW|jj |j|j|j||S(NRt/Rit(NNN(!R}R4R(R?tfileRequiresDataR5tinstalledFileProvidersRR*RRRR&R"RRRRR,RRR~RRRmtgetOldProvidesR&tgetNewProvidesRR2trealpathtgetInstalledPackageObjectttransactionCacheFileRequires(RtfileRequirest
nfileRequirest
reverselookupRttodelRtfilestfilenameRRxRrtevrtalready_brokenRtfnamet
niFP_fnametiFPtoprovRtnprovR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRes		$

!


	
&

	
///	$c
Cs1g}g}x|jjD]}|jj|jdtrCqn|jd}|s^qn|j|x|D]}|\}}}x|jj|||D]e}	|	jd|jdkr|	jd|jdkrqn|j||j	||||	fqWqrWqWx|jjdt
D]}
|
j}t}x|
jjdD]}|st|j|
jt
}n|\}}}x|jj|||D]e}	|	jd|jdkr|	jd|jdkrqn|j||j	||||	fqWqOWq'Wtdr|S|jj||S(NRt	conflictsiiii	(ii	i(R?treturnConflictPackagesRmRRRRRRRRRR,R~RRt transactionCacheConflictPackages(RRtcpkgsRRRAR3RRRBRRy((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRgsB

4		4csNg}t}fd}xjjD]}jj|jdtrRq+n|jd}|smq+n|j|x|D]\}}}xjj	d|D]n}	|	j
j|gsqn|j|	j
grqntd}
j
j|
|	|||	t}qWqWq+WxjjddtD]}t}x|j
jD]}
|sw|j|j
t}nxjj	d|
D]}	|	jtkrqn|	j
|j
krqn|	j
j|j
gsqn|j
j|	j
grqntd}
j
j|
|	|||	t}qWqRWq9Wjj||S(NcsYjj|jjj|jjj|jjpEij|jddS(N(
RmR$RRRRtupR4tpopR((totxmbr(R(s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_do_obs?sRRRxs.Removing %s due to obsoletes from installed %ss$Removing %s due to obsoletes from %s(R,R?treturnObsoletePackagesRmRRRRRRRtobsoletedByR
R1twarningR~R(Rtobsoletes_namesRt transactionCacheObsoletePackages(RtopkgsRRRRtobs_nameRRRRRRytobs_n((Rs0/usr/lib/python2.7/site-packages/yum/depsolve.pyRh:sR	

	
cCsl|jjd|}x!|D]}|jtkrtSqWt|dkrOtS|jjd|shtStS(sReturn whether the given package in installed.

        :param pkgname: the name of the package
        :return: whether the package in installed
        Rxi(	RmRRRR~R$R,R?R(RtpkgnametlstR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytisPackageInstalledus
csjjtjtdt|dd}d}fd}d}i}xI|D]Aj|kr|jjjkrq`n|j<q`W|j}|d$k	rg|D]+t
fd|jDs^q}ni}	x|D]d|	<qWjj
d	d
|	d|x|	jD]jjdj}
|
rBt|
d
}|jr|	cd7<q|jr|	cd7<q|jr|	cd8<qqBqBW|	j}i}x|D]}
x|D]}|
|kr!q	n|
j|krSjj|
jd ||
j<n||
js||
j||
jdr|	|
cd8<nt}|
j|grt}|	|
cd8<jjtjtd||
fn|r|jjjf}njjf}xw|D]o}||
||}|s>qnjjtjtd|
|||f||
kr|	|
cd7<qqWq	W|	|
cd|
jjd7<jjtjtd|
|
jjf||
|r#jjtjtd|
|f|	|
cd7<nj|
jrqjjtjtd|
j|
f|	|
cd7<n|r||
j|j}|dkrjjtjtd||
|f|	|
c|d7<qqqW|d$k	rt |	j}ixS|D]K}
|	|
|kr&q
n||
|}|d$krKiPn||
<q
Wt!dkrjjtjtdt|tdfd}xct"|D]R}||d
krPnjjtjtd||	|cd7<qWqnt |	j}i}x.|D]&}
|	|
|krPq4nd||
<q4Wt!|dkrex9|D]1}
t#|
}j$|}t!|||
<qwWt%|j}jjtjtd|x|D]y}
||
|kr.jjtjtd|
|	|
cd7<q||
}jjtjtd ||
fqWnt |	j}xQ|D]I}
|	|
|krq~n|	|
cd7<|	|
ct!|
jd
7<q~Wt|	j&dd!d"t}jjtjtd#t||S(%sotake the list of pkgs and score them based on the requesting package
           return a dictionary of po=scores"Running compare_providers() for %sicSs`tt|t|}x5t|D]'}||||kr(t||Sq(Wt||S(N(RR$trangeR(RRtminlentnumtoff((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_common_prefix_lens
cSs6t|dstSt|ds&tS|j|jkS(Nt	sourcerpm(RdR,R(RR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_common_sourcerpms
cst||j}jjrQ|dkrQjjtjtd||Snt||j}|dkr||krjjtjtd||S||krdS|S(Nisbetter arch in po %s(	RRtmultilibR1RtRuRlR
R((RRtreq_compare_archtx_distty_dist(R(s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_compare_arch_distancesc	Ssd}xx|jD]m}|\}}\}}}||kr@qn|dkrRqn|dk	rbdS|pkd||pwdf}qW|S(s) This converts a package into a specific version tuple for the
            required provide. The provide _must_ be '=' and epoch=None and
            release=None == '0'.
               If there is 0 or 2+ matches, return None.
               If the req does not == the provide name, return None. RRN(R(R
(	RtprovnameRRRRRRR3((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_pkg2prov_versionsc3s!|]}jd|VqdS(R
N(R(t.0RA(R(s0/usr/lib/python2.7/site-packages/yum/depsolve.pys	<genexpr>sitcompare_providerstproviders_dicttreqpoRxiiiiis%s obsoletes %ss-archdist compared %s to %s on %s
  Winner: %sidi
s'compare_providers_priority for %s is %sscommon sourcerpm %s and %sis#base package %s is installed for %ss%common prefix of %s between %s and %ssprovides vercmp: %sRcst|S(N(R(R(t
prov_depsolve(s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR`ss Winner: %ssrequires minimal: %ds Loser(with %d): %scSs|d|dfS(Nii((R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRstreversesBest Order: %sN('R1RtRuRlR
RRRtvaluesR(tanyRtpluginstruntkeysR?R#RxRR!tverEQR RR%R,RR~Rtbestarchtcompare_providers_priorityRtbase_package_nameRR$treversedRRRtitems(RR7RRRRRRtunique_nevra_pkgsR9t	rpmdbpkgstnewesttlposRtnextpot	obsoletedtarchestthisarchtrestcpltbestnumRtwinnertrec_depsolvet
fake_txmbrtreqsRt	bestorder((RRRs0/usr/lib/python2.7/site-packages/yum/depsolve.pyR's		




#)

	





!N(*RRRRR=R,R<RCRMRNRORDR|RRRRtstaticmethodRRRRRRR>RDRFRWR^R~RMRdRRRReRgRhRt_isPackageInstalledR(R'(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR'jsH						&		F		#							)			{	>	(	M	s	(	;	tDepCheckcBs)eZdZdZdZdZRS(s-Object that :class:`YumDepsolver` uses to see what things are
    needed to close the transaction set. The attributes requires and
    conflicts are lists of requires and conflicts in the current
    transaction set. Each item in the lists is a :class:`Requires` or
    :class:`Conflicts` object.
    cCsg|_g|_dS(N(RR(R((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRs	cCs#t||}|jj|dS(sCreate and add a :class:`Requires` object to the list of
        requires.

        :param po: the package object involved in the requires
        :param req_tuple_list: a list of required by *po* that are
           un-closed in the transaction set
        N(tRequiresRR(RRtreq_tuple_listtreqobj((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytaddRequiress	cCs#t||}|jj|dS(sCreate and add a :class:`Conflicts` object to the list of
        conflicts.

        :param conflict_po_list: a list of conflicting package objects
        :param conflict_item: what the conflict between the members of
           *conflict_po_list is.
        N(t	ConflictsRR(Rtconflict_po_listt
conflict_itemtconfobj((s0/usr/lib/python2.7/site-packages/yum/depsolve.pytaddConflictss(RRRRR
R(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR	s		R
cBseZdZdZRS(sTA pure data class for holding a package and the list of things
    it requires.
    cCs||_||_dS(N(RR(RRR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRs	(RRRR(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR
sRcBseZdZdZRS(s]A pure data class for holding a list packages and what the
    conflict between them is.
    cCs||_||_dS(N(tpkglistRA(RRRA((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRs	(RRRR(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRs(3Rtos.pathRRR.trpmUtils.transactionR[trpmUtils.miscutilst
rpmUtils.archRRR*RRttransactioninfoRRYtpackageSackRtpackagesRt	constantsRuR:R8tsimplefilterR;RR	tyumR
RRtAssertionErrorRR@tRPMSENSE_EQUALR?R(RyRRRR R#R%tobjectR'R	R
R(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt<module>s^
	






		
?"	

OHA YOOOO