v_c@srdZddlZddlZddlZddlZddlZddlm Z m Z ddl Z ddl m Z m Z ddlmZddlZddlmZddlmZddlTddlZddlZddlZejd ejdd lmZdd lmZmZye d d d ks;t!WndZ"dZ nXiej#d6ej$ej#Bd6ej%d6ej%ej$Bd6ej$d6de&6Z'iZ(xe'D]Z)e)e(e'e)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 d6tj d6tj d6tj d6tjd6}ttd rtj|d 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_langstrpmt expandMacrotrpmUtilst transactiontTransactionWrapperRAR)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|||fsRs!Mode is %s for provider of %s: %ssMode for pkg providing %s: %studs"Trying to update %s to resolve depRt requiringPocstxm|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 matchNaevrtappendRt getProvidesRtgetModeR@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|tj tj fkr|\}}}n|j}|j d|||||ffr|jjtd||tStS(Nitprovidess"Quick matched %s to require for %s(t _last_reqR(R,ttypettypest StringTypetNoneTypet UnicodeTypeR[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 setdefaultRt searchNevratlenRRRtreturnNewestByNameR&RRzRtextendR~t_compare_providersRt addUpdateRt yumdb_infoRtmisctstring_to_prco_tupleRR!RR$(%RRRRRxRRRzRRRRRRtupgradedtprovSackR ttspkgsttspkgRtdbpkgstdbpkgRtaRRtrtpkgmodetresultsttresultsRtpkgstbestt 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.statstProfiletruncallt resolveDepstclosetstatstloadt strip_dirst sort_statst print_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(s Call :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}|j r|j j nd}x#t r||j jpdkrdtdgt|fS|d7}t }x[|r;i|_|j r |j jn|j|\}} } } || O}|| O}qWd|_|rt }xI|jD];\} } |j| | \}} }||O}||7}q^W|r|j r|j jn|jjtjtdqqnd|_|rt }xG|jD]9}|j|\}}||O}||7}|rPqqWt rm|jrmt }t }d|_qmn|r|j r|j jn|jjtjtdqqnPqWxo|jjD]^}|j|jr|j dkr|jjtj!td |jd |_ t"|_#qqW|j rn|j j$sM|j j%qn| rn| rn|j j%qnn|jjtjtd t |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_checkFileRequiresRt restartLoopR1RtRuRvt_checkConflictsRDt_checkObsoletesRRRRRRRt skip_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(RRst any_missingRRrRqRRt thisneedstmissing_in_pkgRRRRxRwR((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyRdsX         !      cCsidd6dd6dd6dd6d d 6d d6}|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 j t 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 RmRt inPrcoRangeRRRxRRRRR~( RRt txmbr_reqstoldreqstoldpotretRtprovsRtmember((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyR*s0   " "cCsA|j}|jd}i}x6|j|jD]$}x|jD]}d||jjtjtd|| |cd7|dkrtSx'|jD]}|jd|rtSqWtS(NR (R(R,RRR~(R Rtydep((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt _conflict_reqs  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 ( R tprovnameRRRRRRR3((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyt_pkg2prov_versions   itcompare_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 %sisconflict req %s and %ss#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.pyRfss 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}tpluginstruntkeysR?R#RxRR!tverEQR RR%R,RR~Rtbestarchtcompare_providers_priorityRRtbase_package_nameR(RR$treversedRRRtitems( RR7RRRRRRRtunique_nevra_pkgsR R9tpenalizet rpmdbpkgstnewesttlposRtnextpot obsoletedtarchestthisarchtrestcpltbestnumRtwinnert rec_depsolvet fake_txmbrtreqsRtshiftt bestorder((RRs0/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.pyt addRequiress 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(RRRRRR(((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(R R(RR R((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*RRttransactioninfoRRYt packageSackRtpackagesRt constantsRuR:R8t simplefilterR;RR tyumR R RtAssertionErrorRR@tRPMSENSE_EQUALR?R(RyRRRR R#R%tobjectR'R R R(((s0/usr/lib/python2.7/site-packages/yum/depsolve.pyts^                      L"