MINI MINI MANI MO

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


[c@s]ddlZddlZddlmZmZddlTddlmZddl	Z
ddlZddlZd"Z
d
ZdZdZd
ZdZdZdZdZdZddZdZdZdZdZdZdZdZdZ dZ!dZ"ddZ#ddZ$dd Z%gd!Z&dS(#iN(t_tP_(t*(tINFO_1tsecuritytbugfixtenhancementtrecommendedt
newpackagecCs=tjj|d|d|df|d|d|dfS(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_refsscCsx|D]}tj||r#|Stj|d|r=|S|}|jdp^|jdsnd|}nxbt|dD]P}|ddkrqntj|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_id6scCst|j||}|r-t|d|<tS|jr_|d|jkr_t|d|d<tS|jr|ddkr|d|jkrt|d|d<tS|jrt||dd	|jrtS|jrt||dd
|jrtS|jr1|ddkr1|js-d|ks-|dr1tS|j	rN|ddkrNtS|jp|jp|jp|jp|j	p|jp|jstSt
S(s; Do the package filtering for should_show and should_keep. tcmdRRRRtseveritytsevRtcvetbugzillaR(RRRtadvisoryR%R'R#tbzRtbugfixestFalse(toptsRRR trcmd((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_ysp_should_filter_pkgAs2%%$cCsY|tkr#|d|kr#|Snx/t|dD]}|d|krPq4n|SWdS(NRR(t_update_info_types_R(trnametmdR((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_ysp_has_info_md`scCs5|jp3|jp3|jp3|jp3|jp3|jS(N(RR+R)R*R'R%(R-((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_no_optionsiscCstj}g|_|jdg|_|jdg|_|jdg|_|jdg|_|jdt|_	|jdt|_
|S(NtadvstbzstcvestsevsRR(tmisct
GenericHolderRtgetR)R*R'R%R,R+R(tupdateinfo_filtersR-((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_updateinfofilter2optsms	cCskidd6dd6dd6dd6dd6dd6dd6dd	6dd
6dd6dd6dd6dd
6dd6dd6dd6dd6dd6}itd6td6}x|D]}|jdd}d}d|kr|jdd\}}n!||kr|}n|}d}||krqn||}|dkr?||||<n#|j|g|jd||<|SWdS(NR5R)t
advisoriesR6R*R7R'R8ssecurity-severityssecurity-severitiesR%t
severitiesR&RtsecRR+tbugst t,t=ittrue(ssecuritysbugfix(R,treplacetsplitR;(targstT_maptfilterstarg0tTtarg1((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt
_args2filters{sF


	
#cCsd}t|}|dk	r-||_nx^ddgD]P}t||}t||}tt|t|B}t|||q:W|S(NcSs/d}tj||}|r+|jdS|S(Ns^(RH[BES]A\-\d+\:\d+)(\-\d+)?$i(tretmatchtgroup(tid_tpatternRP((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pytstrip_respins

RR)(R=RRtgetattrtmaptlisttsettsetattr(RJRRTR-tattrtoldlisttstrippedtnewlist((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt
_ysp_gen_optss	cCsiid6id6id6id6id6}tr3|Sx|jD]}t|d|<q=Wx|jD]}t|d|<q_Wx|jD]}t|d|<qWx|jD]}t|d|<qWx|jD]}t|d|<qW|S(NR(R'RR$R&(RRR,R)R*R'R%(R-R R((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_ysp_gen_used_maps)cCsx1|dD]%}|d|s|d|qqWx1|dD]%}|d|s?|d|q?q?Wx1|dD]%}|d|ss|d|qsqsWx1|dD]%}|d|s|d|qqWx1|d	D]%}|d	|s|d
|qqWdS(NR$s$No update information found for "%s"Rs2Advisory "%s" not found applicable for this systemR(s,BZ "%s" not found applicable for this systemR's-CVE "%s" not found applicable for this systemR&s2Severity "%s" not found applicable for this system((R tmsgR((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_ysp_chk_used_mapscCs\i}xO|D]G}|d|krFt||d|dkrFq
n|||d<q
W|S(Ni(R(tbasetpkgtupstname2tuptpkgtup((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_get_name2pkgtups
cCs(td|jj}t||S(s? Get the pkgtups for all installed pkgs. which have an update. cSs|dS(Ni((tx((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt<lambda>s(RVtuptgetUpdatesTuplesRf(Rbtoupdates((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_get_name2oldpkgtupscCst||jjS(s) Get the pkgtups for all installed pkgs. (Rftrpmdbt
simplePkgList(Rb((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_get_name2instpkgtupscCsFg|jjD]#}|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|jjD]#}|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|}|sq<n|d}d}|ddkrd|d}nd|d||d	|d
|df}	|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`tkern_pkgtupt	found_secReRtipkgtetrpkg((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt_check_running_kernel2s*

csfd}|dkr*j}nt|}t|rFdSj}d}d}t|}jj}t}	tt	t
g}
t}x0|D](}|j|
kr|j|j
qqWt}
x|D]}|j|
kr	|d7}n|j
j}||
kst||
|||rAqn|j|
kr]|d7}n|	j|j
qW|}t}x|r`t}x|D]}|j
|	krx|jD]G\}}||	kr||kr|d7}n|	j|t}qqWqxV|jD]K\}}||	kr
||kr;|d7}n|	j|j
t}Pq
q
WqWqWx*|D]"}|j
|	krh||qhqhWt|fd|rjjttd||||fnjjttd||||fS(	sJ
    Remove packages from the transaction, using the updateinfo data.
    cs@jjttd|j|jjfj|jdS(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.pytysp_del_pkgQs	iicsjjd|S(Ns%s(Rtwarn(Rg(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRhssD%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_statetaddRRlRxRyRR,t	relatedtoRaRRRR(RbRJRR-RwttottcntR ttspkgst	keep_pkgstcount_statest
count_pkgsRRdRxtscnttmini_depsolve_againRtreason((RbRs2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt
remove_txmbrsLsp				



	




-csdfd}|d
kr*j}nt|}t|rFdSj}t|}ttjddj	jddj
}jj}t
}g}	xS|D]K}
|
j}||kst|||||r|	j|
jqqqW|	rEx6jddd|	d	tjD]}||q.Wnttjddj	jddj
}
t|fd
|
rjjttd|
|fnjjttd||
|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(RRRRtrepoidRtsackt
delPackage(tpkgR(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRs	it	pkgnarrowtupdatest	obsoletest	availabletpatternstshowdupscsjjd|S(Ns%s(RR(Rg(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRhss6%d package(s) needed for security, out of %d availables6No packages needed for security; %d packages availableN(ii(RR<R^R4RR_tlenRXtdoPackageListsRRRttreturnPackagesRlRxRytappendRRRaRRRR(RbRJRR-RwR RtpkgsRdtpkgs_to_delRRxtpR((Rbs2/usr/lib/python2.7/site-packages/yum/updateinfo.pytexclude_updatess:	
	
(&csOdfd}|dkr*j}nt|}t|rFd	Sj}t|}jj}t}d}d}	xa|D]Y}
|d7}|
j	}||kst
|||||r||
qn|	d7}	qWt|fd|	r(jj
ttd|	|fnj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(RRRRRRRR(RR(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRs	iicsjjd|S(Ns%s(RR(Rg(Rb(s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyRhss6%d package(s) needed for security, out of %d availables6No packages needed for security; %d packages availableN(ii(RR<R^R4RR_RtRRuRxRyRaRRRR(RbRJRR-RwR RRdRRRRx((Rbs2/usr/lib/python2.7/site-packages/yum/updateinfo.pytexclude_alls2	

	
&cCs4g}t|j}t|j}t|}td|jj}xt|D]}|jj	|}|r|j
nx|D]\}	}
|	d}|rt|||
rqn|rt|||
|rqn|j
|jd|	dd|	dd|	dd|	d	d
|	dPqWqXW|S(sMark 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	oldpkgtupRReRRx((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pytupdate_minimals*

#
	(ssecuritysbugfixRRR('tos.pathRROtyum.i18nRRt
yum.constantstyum.logginglevelsRtrpmUtils.miscutilsR	R9RR0RRRR#R/R3R4R=RNRR^R_RaRfRlRoRsRuRyRRRRRR(((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt<module>sB
										5"											T4.

OHA YOOOO