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/usr/lib/python2.4/site-packages/repomd/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/repomd/packageSack.pyo
mò
ýÉODc@sbdkZdklZdkZdfd„ƒYZdefd„ƒYZdefd„ƒYZdS(N(sPackageSackErrortPackageSackcBstZdZd„Zd„Zd„Zdd„Zd„Zeeeeed„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zed„Zed„Zed„Zed„Zd„Zd„ZRS(s*represents sets (sacks) of Package ObjectscCs^h|_h|_h|_h|_h|_h|_h|_h|_d|_
d|_dS(Ni(tselftnevrat	obsoletestrequirestprovidest	conflictst	filenamest
pkgsByRepotpkgsByIDtNonetcompatarchstindexesBuilt(R((t6/usr/lib/python2.4/site-packages/repomd/packageSack.pyt__init__s									cCst|iƒƒS(N(tlenRt
simplePkgList(R((R
t__len__'scCs>t|iƒdƒo|iƒiƒSnt|iƒƒSdS(Nt__iter__(thasattrRtreturnPackagesRtiter(R((R
R*sterrorcCsG|ip9|djo
td‚qC|djo|iƒqCndS(scheck to see if the indexes are built, if not do what failure demands
           either error out or build the indexes, default is to error outRs$Indexes not yet built, cannot searchtbuildN(RRtfailuretPackageSackErrortbuildIndexes(RR((R
t
_checkIndexes0s



cCs=|\}}}}}|id|d|d|d|d|ƒS(s5return a list of package objects by (n,a,e,v,r) tupletnametarchtepochtvertrelN(tpkgtuptntatetvtrRtsearchNevra(RR!R#R$R"R%R&((R
tpackagesByTuple:scCsX|iddƒ|ii|||||fƒo|i|||||fSngSdS(s6return list of pkgobjects matching the nevra requestedRRN(	RRRthas_keyRRRR R(RRRRR R((R
R'?s
"cCs:|iddƒ|ii|ƒo|i|SngSdS(s&return list of packages based on pkgidRRN(RRR	R)tpkgid(RR*((R
tsearchIDHs
cCs:|iddƒ|ii|ƒo|i|SngSdS(s<return list of package requiring the name (any evr and flag)RRN(RRRR)R(RR((R
tsearchRequiresPs
cCsp|iddƒg}|ddjo|i|i|ƒƒn|ii|ƒo|i|i|ƒn|S(s<return list of package providing the name (any evr and flag)RRit/N(RRt
returnListRtextendtsearchFilesRR)(RRR.((R
tsearchProvidesXscCs:|iddƒ|ii|ƒo|i|SngSdS(sCreturn list of package conflicting with the name (any evr and flag)RRN(RRRR)R(RR((R
tsearchConflictsds
cCs:|iddƒ|ii|ƒo|i|SngSdS(s=return list of package obsoleting the name (any evr and flag)RRN(RRRR)R(RR((R
tsearchObsoletesls
cCs‘h}x„|iƒD]v}|iƒ}t|idƒƒdjoqn|i|ƒp|idƒ||<q||i	|idƒƒqW|S(sEreturns a dict of obsoletes dict[obsoleting pkgtuple] = [list of obs]RiN(
tobsRRtpotreturnPackageTupletpkgtupleRt
returnPrcoR)R/(RR7R4R5((R
treturnObsoletests
cCs:|iddƒ|ii|ƒo|i|SngSdS(sqreturn list of packages by filename
           FIXME - need to add regex match against keys in file list
        RRN(RRRR)tfile(RR:((R
R0ƒs
cCs3|i|ƒpg||<n||i|ƒdS(N(tdictR)tkeytappendtdata(RR;R<R>((R
t_addToDictAsListscCso|i|ƒpg||<ny||i|ƒWntj
onXt||ƒdjo||=ndS(Ni(R;R)R<tremoveR>t
ValueErrorR(RR;R<R>((R
t_delFromListOfDict”scCs|idƒ}|iƒ\}}}}}|i
o1|i
i|ƒo|i|i
||ƒq{n|i|i
||ƒdS(s"add a pkgobject to the packageSacktrepoidN(tobjtreturnSimpleRCtreturnNevraTupleRRRR RRRR)R?R(RRDRRR RRRC((R
t
addPackage s
c	CsQh|_h|_h|_h|_h|_h|_h|_x|ii	ƒD]ñ}
xè|i|
D]Ù}x?|idƒD].\}}\}}
}|i|i||ƒqyWx?|idƒD].\}}\}}
}|i|i||ƒq»Wx?|idƒD].\}}\}}
}|i|i||ƒqýWx?|idƒD].\}}\}}
}|i|i||ƒq?WxD|iƒD]6}x-|i|ƒD]}	|i|i|	|ƒq”Wq~W|i|i|idƒ|ƒ|iƒ\}}}}}|i|i|||||f|ƒ|i|i|ddddf|ƒqcWqOWd|_dS(s¦builds the useful indexes for searching/querying the packageSack
           This should be called after all the necessary packages have been 
           added/deletedRRRRtidiN( RRRRRRRR	RtkeysRCRDR8R"tflR$R%R&R?treturnFileTypestftypetreturnFileEntriesR:RERFRRRR RR
R(RRLR R$RRR"RR&R:R%RDRJRCR((R
R­sD							
%-cCs:|i|i|idƒ|ƒ|io
d|_ndS(sdelete a pkgobjectRCiN(RRBRRDRER(RRD((R
t
delPackageÓs
cCspg}|djo2xV|iiƒD]}|i|i|ƒq#Wn(y|i|}Wntj
onX|S(s2return list of all packages, takes optional repoidN(	R.RCR
RRRItrepoR/tKeyError(RRCROR.((R
RÙs
cCsXh}|oA|ii|dddddfƒ}
|
ptd|‚qZn
|iƒ}
x½|
D]µ}|i
ƒ\}}}}	}|i||fƒp||||f<qa|||f}
|
iƒ\}}}ti|||	f|||fƒ}|djo||||f<qaqaW|o-|i|ƒo||SqNtd|‚n|iƒS(sôreturn 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 comparedisNo Package Matching %s.%sN(thighdicttnaTupRRtgetR
twhereRRtpkgRFR"R$R%R&R#R)tpkg2t	returnEVRte2tv2tr2tmdUtilst
compareEVRtrctvalues(RRRR#R$RZRQR]R"RYR&RVRUR%RTRX((R
treturnNewestByNameArchès,%$
cCs,h}xå|iƒD]×}
|
iƒ\}}}}}|i
|ƒpg||<||i|
ƒq||d}	|	i
ƒ\}
}}ti|||f|
||fƒ}|djo|
g||<q|djo||i|
ƒqqW|o-|i
|ƒo||Sq"td|‚n|iƒS(sµreturn list of newest packages based on name matching
           this means(in name.arch form): foo.i386 and foo.noarch will
           be compared to each other for highest versionisNo Package Matching  %sN(RQRRRURFR"R$R%R&R#R)R=RVRWRXRYRZR[R\R]RRR^(RRR#R$RZR]R"RYR&RVRUR%RQRX((R
treturnNewestByName
s(

$

cCs7g}x*|i|ƒD]}|i|iƒƒqW|S(sLreturns a list of pkg tuples (n, a, e, v, r) optionally from a single repoidN(t
simplelistRRRCRUR=R6(RRCRaRU((R
R%scCs&x|iƒD]}|iƒGHq
WdS(N(RRRUtreturnNevraPrintable(RRU((R
t
printPackages,s
cCs<x5|iƒD]'}|i|jo|i|ƒq
q
WdS(sDexclude incompatible arches. archlist is a list of compatible archesN(RRRURtarchlistRN(RRdRU((R
texcludeArchs0s

(t__name__t
__module__t__doc__RRRRR(R
R'R+R,R1R2R3R9R0R?RBRGRRNRR_R`RRcRe(((R
Rs2			
									
			
	&	"	tXMLPackageSackcBsStZdZd„Zed„Zdd„Zed„Zed„Zed„Z	RS(s…Derived class from PackageSack to build list from XML metadata file. 
       Needs the Package Object Class passed to it for the SackcCs#ti|ƒh|_||_dS(N(RRRt
repoStatustpkgObjectClass(RRk((R
RAs
	cCsyti|ƒ}Wn#tij
otd|‚nÛX|iƒ|iƒ}|djo1|i
|ddƒp|i|||ƒqn†|djo1|i
|ddƒp|i|||ƒqnH|djo1|i
|ddƒp|i|||ƒqn
d|GHd	S(
sÒtakes a repository id and an xml file. It populates whatever it can, 
           if you try to populate with a filelist or other metadata file 
           before the primary metadata you'll not like the resultss Invalid or non-existent file: %stmetadatat	itemchecktprimaryt	filelistst	otherdatatothers$Error: other unknown root element %sN(tlibxml2tnewTextReaderFilenameR:treadert	treeErrorRtReadtNametxmlfiletypeRt_checkRepoStatusRCt
loadPrimaryMDtcallbackt
loadFileMDtloadOtherMD(RRCR:R{RxRt((R
taddFileIs"



RncCs7|ii|ƒo ||i|jodSq3ndS(s return 1 if itemcheck is in repoiiN(RRjR)RCRm(RRCRm((R
Ryes
cCsrd}d}|iƒot|idƒƒ}n|iƒ}xÝ|oÕ|iƒdjo|iƒ}qAn|iƒdjok|i	ƒdjoX|iƒoG|idƒdjo-|d7}|i||ƒ}|i|ƒqèqìn|o|||d|ƒn|iƒ}qAqAW|ii|ƒpg|i|<nd	|i|jo|i|id	ƒnd
S(s4load all the data from the primary metadata xml filei'itpackagesitpackagettypetrpmRRnN(tpkgcounttcurrentRtt
HasAttributestinttGetAttributeRvtrettNodeTypeRwRRkRCR5RGR{RjR)R=(RRtRCR{RƒRˆR5R„((R
Rzls2
&

cCsJd}d}|iƒot|idƒƒ}n|iƒ}xÏ|oÇ|iƒdjo|iƒ}qAn|iƒdjo]|i	ƒdjoJ|iƒo9|idƒ}|i|ƒ}
d}|iƒ}|d7}xç|
D]ß}
|
idƒ|joÃ|iƒ|d7}x¬|iƒd	jo|iƒ|joPnj|iƒdjo|iƒ}qnD|iƒdjo0|iƒd
jo|
i|ƒ\}	}q©n|iƒ}qqWqâqâW|djoqÚqÞn|iƒ}|o|||d|ƒqAqAqAWd|i|jo|i|idƒn|iƒd
S(s,load all the filelist metadata from the filei'iRiR€R*iRCiR:RtfilelistN(RƒR„RtR…R†R‡RvRˆR‰RwR*RR+tpkgstpkgmatchtDepthtmydepthRURERCt	LocalNamet
loadFileEntryRLR:R{RjR=R(RRtRCR{R*R:RƒRˆR„RLR‹RŽRŒRU((R
R|sX
&



&
cCsBd}d}|iƒot|idƒƒ}n|iƒ}xÇ|o¿|iƒdjo|iƒ}qAn|iƒdjoU|i	ƒdjoB|d7}|iƒo'|idƒ}|i|ƒ}d}
|iƒ}	xß|D]×}|idƒ|jo»|iƒ|
d7}
x¤|iƒd	jo|iƒ|	joPnb|iƒdjo|iƒ}qn<|iƒdjo(|iƒd
jo|i|ƒq¡n|iƒ}qqWqâqâW|
djoqÒqÖn|o|||d|ƒn|iƒ}qAqAWd|i|jo|i|idƒn|iƒd
S(s4load the changelog, etc data from the other.xml filei'iRiR€R*iRCit	changelogRRqN(RƒR„RtR…R†R‡RvRˆR‰RwR*RR+R‹RŒRRŽRURERCRtloadChangeLogEntryR{RjR=R(RRtRCR{R*RƒRˆR„R‹RŽRŒRU((R
R}ÈsX
&



&
(
RfRgRhRR
R~RyRzR|R}(((R
Ri>s	!;tListPackageSackcBs#tZdZed„Zd„ZRS(sªDerived class from PackageSack to build new Sack from list of
       pkgObjects - like one returned from self.returnNewestByNameArch()
       or self.returnNewestByName()cCs/ti|ƒ|dj	o|i|ƒndS(N(RRRtObjlistR
taddList(RR”((R
Rs

cCs"x|D]}|i|ƒqWdS(N(tObjListtpkgobjRRG(RR–R—((R
R•s(RfRgRhR
RR•(((R
R“s(RrtmdErrorsRR[RRiR“(RRrR“R[RRi((R
t?s	
	ÿ*Ã

Anon7 - 2021