ok

Mini Shell

Direktori : /proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/yum/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/yum/updateinfo.pyc

�
8M�bc@s]ddlZddlZddlmZmZddlTddlmZddl	Z
ddlZddl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_1tsecuritytbugfixtenhancementtrecommendedt
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|<tS|jr_|d|jkr_t|d|d<tS|jr�|ddkr�|d|jkr�t|d|d<tS|jr�t||dd	|j�r�tS|jr�t||dd
|j�r�tS|jr1|ddkr1|js-d|ks-|dr1tS|j	rN|ddkrNtS|jp�|jp�|jp�|jp�|j	p�|jp�|js�tSt
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|d�D]}|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_optionsiscCs�tj�}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}||krq�n||}|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


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

RR)(R=RRtgetattrtmaptlisttsettsetattr(RJRRTR-tattrtoldlisttstrippedtnewlist((s2/usr/lib/python2.7/site-packages/yum/updateinfo.pyt
_ysp_gen_opts�s	cCs�iid6id6id6id6id6}tr3|Sx|jD]}t|d|<q=Wx|jD]}t|d|<q_Wx|jD]}t|d|<q�Wx|jD]}t|d|<q�Wx|jD]}t|d|<q�W|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_map�s)cCsx1|dD]%}|d|s|d|�qqWx1|dD]%}|d|s?|d|�q?q?Wx1|dD]%}|d|ss|d|�qsqsWx1|dD]%}|d|s�|d|�q�q�Wx1|d	D]%}|d	|s�|d
|�q�q�WdS(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_map�scCs\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_name2pkgtup�s
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_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
|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*

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.pytysp_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
��}�jj�}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^R4R�R_tlenRXtdoPackageListsR�R�RttreturnPackagesRlRxRytappendRR�RaR�R�RR(RbRJR�R-RwR R�tpkgsRdtpkgs_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^R4R�R_RtR�RuRxRyRaR�R�RR(RbRJR�R-RwR R�RdR�R�R�Rx((Rbs2/usr/lib/python2.7/site-packages/yum/updateinfo.pytexclude_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^R4RVRiRjtsortedR�RvtreverseRR/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.pyt<module>sB
										5"											T4.

Zerion Mini Shell 1.0