ó ð v_c@s]ddlZddlZddlmZmZddlTddlmZddl Z ddl Z ddl Z d"Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"dd„Z#dd„Z$dd „Z%gd!„Z&dS(#iÿÿÿÿN(t_tP_(t*(tINFO_1tsecuritytbugfixt enhancementt recommendedt newpackagecCs=tjj|d|d|df|d|d|dfƒS(s- Compare two "std." tuples, (n, a, e, v, r). iii(trpmUtilst miscutilst compareEVR(ttup1ttup2((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_rpm_tup_vercmps!cCs|s gS|S(sj Sometimes refs == None, if so return the empty list here. So we don't have to check everywhere. ((trefs((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_ysp_safe_refsscCsÛxÔ|D]Ì}tj||ƒr#|Stj|d|ƒr=|S|}|jdƒp^|jdƒsnd|}nxbt|dƒD]P}|ddkr›qntj|d|ƒrµ|Stj|d|ƒr|SqWqWdS(Nt update_idsCVE-Rt referencestid(tfnmatcht startswithRtNone(tsec_cmdstpkgnametnoticetitcveitref((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_match_sec_cmd#s    cCsZxSt|ƒD]E}|d|kr)q n|d|kr?q nt|||d<|SWdS(s# Check if the given ID is a match. ttypeRN(RtTrueR(tused_mapRtref_typetref_idsR((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_has_id6scCs•t|j||ƒ}|r-t|d|ÿs(RVtuptgetUpdatesTuplesRf(Rbtoupdates((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_get_name2oldpkgtupýscCst||jjƒƒS(s) Get the pkgtups for all installed pkgs. (Rftrpmdbt simplePkgList(Rb((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_get_name2instpkgtupscCsFg|jjƒD]#}|d|ddddf^q}t||ƒS(sa Get the pkgtups for all installed pkgs. and munge that to be the first possible pkgtup. iit0(RmRnRf(Rbtpttofirst((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_get_name2allpkgtups9cCsFg|jjƒD]#}|d|ddddf^q}t||ƒS(sa Get the pkgtups for all available pkgs. and munge that to be the first possible pkgtup. iiRp(tpkgSackRnRf(RbRqRr((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_get_name2aallpkgtup s9cCsG|d}x6|j|ƒD]%\}}t||||ƒrtSqWtS(sA Do we want to keep this package to satisfy the security limits. i(tget_applicable_noticesR/RR,(R-Retmd_infoR tnameR((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_ysp_should_keep_pkgs  cCs~t}xq|D]i}y|jjdƒ}Wn q nX|jdtjj|jdƒ}tjj|ƒs t }Pq q W|S(Nt updateinfot/i( RtrepoXMLtgetDatatcachedirtostpathtbasenametlocationtexistsR,(trepostdledtrepotdataR€((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_repos_downloaded"s $c Cstj|jƒ}|ddkr&dSt}xà|j|ƒD]Ï\}}|s<|ddkrdq<nt}|jj|ƒ}|sˆq<n|d}d}|ddkr¹d|d}nd|d||d |d |d f} |t d ƒ|ƒ|t d ƒ| ƒPq<WdS(NiRRtiRps%s:s %s-%s%s-%s.%siiis,Security: %s is an installed security updates-Security: %s is the currently running version( R9tget_running_kernel_pkgtupttsRR,RvRRmtsearchPkgTupleR( tybRwR`t kern_pkgtupt found_secReRtipkgtetrpkg((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_check_running_kernel2s*  cs‡‡fd†}|dkr*ˆj}nt|ƒ}t|ƒrFdSˆj}d}d}t|ƒ}ˆj‰ˆjƒ}tƒ} tt t gƒ} tƒ} x0|D](} | j | kr¨| j | j ƒq¨q¨Wtˆƒ} xŽ|D]†} | j | kr |d7}n| j j}|| ksçt|| |||ƒ rAqçn| j | kr]|d7}n| j | j ƒqçW|}t}xá|r`t}xÎ|D]Æ} | j | krx®| jD]G\}}|| kr²|| krã|d7}n| j |ƒt}q²q²Wq“xV| jD]K\}}|| kr || kr;|d7}n| j | j ƒt}Pq q Wq“Wq€Wx*|D]"} | j | krh|| ƒqhqhWt|‡fd†ƒ|r׈jjttdƒ||||fƒnˆjjttdƒ|ƒ|||fS( sJ Remove packages from the transaction, using the updateinfo data. cs@ˆjjttdƒ|j|jjfƒˆj|jƒdS(s) Deletes a package within a transaction. s$ --> %s from %s removed (updateinfo)N(tverbose_loggertlogRRtpot ui_from_repotremoveRe(ttspkg(Rbttsinfo(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt ysp_del_pkgQs  iicsˆjjd|ƒS(Ns%s(R”twarn(Rg(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRh—ssD%d package(s) needed (+%d related) for security, out of %d availables6No packages needed for security; %d packages availableN(iii(RR<R^R4tupinfoR_ttsInfot getMembersRXtTS_INSTALL_STATEStTS_ERASEt output_statetaddR–RlRxRyRR,t relatedtoRaR”R•RR(RbRJR›R-RwttottcntR ttspkgst keep_pkgst count_statest count_pkgsR™RdRxtscnttmini_depsolve_againR’treason((RbRšs2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt remove_txmbrsLsp                           -csâd‡fd†}|d kr*ˆj}nt|ƒ}t|ƒrFdSˆj}t|ƒ}ttˆjddƒj ˆjddƒj ƒƒ}ˆj j ƒ}t ˆƒ}g} xS|D]K} | j} | |ksìt||| ||ƒ r·| j| jƒq·q·q·W| rEx6ˆjddd| d tƒjD]} || ƒq.Wnttˆjddƒj ˆjddƒj ƒƒ} t|‡fd †ƒ| r»ˆjjttd ƒ| |fƒnˆjjttd |ƒƒ| |fS(sM Exclude all packages to do with updates, using the updateinfo data. Rzcs@ˆjjttdƒ||j|fƒ|jjj|ƒdS(s7 Deletes a package from all trees that yum knows about s --> %s from %s excluded (%s)N(R”R•RRtrepoidR†tsackt delPackage(tpkgR­(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyR›¥s  it pkgnarrowtupdatest obsoletest availabletpatternstshowdupscsˆjjd|ƒS(Ns%s(R”Rœ(Rg(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRhËss6%d package(s) needed for security, out of %d availables6No packages needed for security; %d packages availableN(ii(RR<R^R4RR_tlenRXtdoPackageListsR´RµRttreturnPackagesRlRxRytappendRR¶RaR”R•RR(RbRJR›R-RwR R¥tpkgsRdt pkgs_to_delR²RxtpR¦((Rbs2/usr/lib/python2.7/site-packages/yum/updateinfo.pytexclude_updates s:           (&c sOd‡fd†}|dkr*ˆj}nt|ƒ}t|ƒrFd Sˆj}t|ƒ}ˆjjƒ}tˆƒ}d}d} xa|D]Y} |d7}| j } | |ksÈt ||| ||ƒ rØ|| ƒq‰n| d7} q‰Wt |‡fd†ƒ| r(ˆj j ttdƒ| |fƒnˆj j ttd|ƒƒ| |fS( s: Exclude all packages, using the updateinfo data. Rzcs@ˆjjttdƒ||j|fƒ|jjj|ƒdS(s7 Deletes a package from all trees that yum knows about s --> %s from %s excluded (%s)N(R”R•RRR¯R†R°R±(R²R­(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyR›Ùs  iicsˆjjd|ƒS(Ns%s(R”Rœ(Rg(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRhùss6%d package(s) needed for security, out of %d availables6No packages needed for security; %d packages availableN(ii(RR<R^R4RR_RtR»RuRxRyRaR”R•RR( RbRJR›R-RwR R½RdR¥R¦R²Rx((Rbs2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt exclude_allÔs2            &c Cs4g}t|jƒ}t|jƒ}t|ƒ}td„|jjƒƒ}xât|ƒD]Ô}|jj |ƒ}|rƒ|j ƒnx¦|D]ž\} } | d} |r¿t || | ƒ r¿qŠn| rât || | |ƒ râqŠn|j |jd| dd| dd| dd| d d | d ƒƒPqŠWqXW|S( sÑMark the specified items to be updated, in the minimal way. :param extcmds: the user specified arguments :return: a list of transaction members added to the transaction set by this function cSs|dS(Ni((Rg((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRhsiRxtarchitepochitversionitreleasei(R_R<R^R4RVRiRjtsortedRRvtreverseRR/textendtupdate( RbtextcmdsttxmbrsR R-tndataRkt oldpkgtupR‡ReRRx((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pytupdate_minimals*   #  (ssecuritysbugfixRRR('tos.pathRROtyum.i18nRRt yum.constantstyum.logginglevelsRtrpmUtils.miscutilsR R9RR0RRRR#R/R3R4R=RNRR^R_RaRfRlRoRsRuRyRˆR“R®RÀRÁRÎ(((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pytsB             5 "          T 4 .