MINI MINI MANI MO

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


[c@sdZddlmZddlZddlZddlZddlZddlmZddl	Z
ddl	mZdfdYZde
fd	YZd
efdYZdefd
YZdZdZdefdYZdS(s;
Classes for manipulating and querying groups of packages.
i(tPackageSackErrorN(t
parsePackages(t
compareEVRtPackageSackVersioncBs5eZdZdZdZdZdZRS(cCs"d|_tjdg|_dS(Nitsha1(t_numtmisct	Checksumst_chksum(tself((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt__init__s	cCsd|j|jjfS(Ns%u:%s(RRt	hexdigest(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt__str__#scCs|dkrtSt|tdtdfkrDt||kS|j|jkrZtS|jj|jjkr|tStS(Ntu(tNonetFalsettypetstrRRtdigesttTrue(R	tother((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt__eq__&s$cCs||kS(N((R	R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt__ne__-scCs`|jd7_|jjt||dk	r\|jj|d|jj|dndS(Nii(RRtupdateRR(R	tpkgtcsum((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR0s
(t__name__t
__module__R
RRRR(((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRs
				tPackageSackBasecBseZdZdZdZdZdZdZdZdZ	d%d%d%d%d%dZged	Z
d
ZdZd%d%d%d%d%d%dZd%d&d
Zd%d'dZdZdZdZdZedZdZdZdZdZdZd%d%edZdZeidZd%d%edZ d%d%edZ!d%edZ"dZ#d Z$d!Z%d"Z&d#Z'd%d$Z(RS((s8Base class that provides the interface for PackageSacks.cCs
i|_dS(N(tadded(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR
:scCst|jS(N(tlentreturnPackages(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt__len__=scCs3|j}t|dr%|jSt|SdS(Nt__iter__(RthasattrR!titer(R	tret((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR!@s
cCs|dkrdSt|j}t|j}t|t|krZt|t|SxBtt|t|D]%\}}t||}|rv|SqvWdS(Nii(RtlistRRtziptsortedtcmp(R	Rts_reposto_reposts_repoto_repoR$((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt__cmp__Gs(cCs
tdS(N(tNotImplementedError(R	tcompatArchs((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsetCompatArchsUscCs
tdS(N(R.(R	trepotmdtypetcallbackt	cacheOnly((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytpopulateXscCs#tjdtdd|j|S(s5return a list of package objects by (n,a,e,v,r) tuples;packagesByTuple() will go away in a future version of Yum.
t
stackleveli(twarningstwarntDeprecationWarningtsearchPkgTuple(R	tpkgtup((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytpackagesByTuple[s	
cCs
tdS(s6return list of pkgobjects matching the nevra requestedN(R.(R	tnametepochtvertreltarch((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchNevracscCs
tdS(N(R.(R	tnamestreturn_pkgtups((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchNamesgscCs7|jd|jd|jd|jd|jd|jS(srreturn list of package objects matching the name, epoch, ver, rel,
           arch of the package object passed inR=R>R?R@RA(RBR=R>R?R@RA(R	tpo((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchPOjs$cCs=|\}}}}}|jd|d|d|d|d|S(s7return list of pkgobject matching the (n,a,e,v,r) tupleR=RAR>R?R@(RB(R	R;tntatetvtr((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR:qscCsd|r6|j}|j}|j}|j}|j}nt|jd|d|d|d|d|S(spreturn if there are any packages in the sack that match the given NAEVR 
           or the NAEVR of the given poR=RAR>R?R@(R=RAR>tversiontreleasetboolRB(R	R=RAR>R?R@RF((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytcontainsvs				cCs
tdS(s5return dict { packages -> list of matching provides }N(R.(R	R=tflagsRM((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytgetProvidesscCs
tdS(s5return dict { packages -> list of matching requires }N(R.(R	R=RQRM((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytgetRequiresscCs
tdS(s<return list of package requiring the name (any evr and flag)N(R.(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchRequiresscCs
tdS(s<return list of package providing the name (any evr and flag)N(R.(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchProvidesscCs
tdS(sCreturn list of package conflicting with the name (any evr and flag)N(R.(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchConflictsscCs
tdS(s=return list of package obsoleting the name (any evr and flag)N(R.(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchObsoletesscCs
tdS(sEreturns a dict of obsoletes dict[obsoleting pkgtuple] = [list of obs]N(R.(R	tnewest((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytreturnObsoletesscCs
tdS(sb Is calling pkg.returnFileEntries(primary_only=True) faster than
            using searchFiles(). N(R.(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pythave_fastReturnFileEntriesscCs
tdS(s#return list of packages by filenameN(R.(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchFilesscCs
tdS(s"add a pkgobject to the packageSackN(R.(R	tobj((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt
addPackagescCs
tdS(sbuilds the useful indexes for searching/querying the packageSack
           This should be called after all the necessary packages have been
           added/deletedN(R.(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytbuildIndexesscCs
tdS(sdelete a pkgobjectN(R.(R	R\((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt
delPackagescCs
tdS(sreturn list of all packagesN(R.(R	trepoidtpatternstignore_case((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRscGs
tdS(s Add an "excluder" for all packages in the repo/sack. Can basically
            do anything based on nevra, changes lots of exclude decisions from
            "preload package; test; delPackage" into "load excluder".
            Excluderid is used so the caller doesn't have to track
            "have I loaded the excluder for this repo.", it's probably only
            useful when repoid is None ... if it turns out utterly worthless
            then it's still not a huge wart. N(R.(R	R`t
excluderidtexcludertargs((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytaddPackageExcluderscCsVd}t}i}i}i}xt|jD]}|j}	|j||	x^|D]V}
|j||
kr`|
|krt||
<i||
<n||
j||	q`q`W|rq7n|jjj}|||j	|||	xA|D]9}
|j||
kr|||
|j	|||	qqWq7W|rL||||gS||gS(s5 Return a simple version for all available packages. cSso|j|i}|jdt}|j|||dk	rk|j|t}|j||ndS(N(t
setdefaultRRR(tareposR`trevRRtarevstrpsv((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt_up_revss(
RR'RtreturnIdSumRR=R1trepoXMLtrevisionR`(R	t	main_onlytgroupsRltmainRht	main_grpstarepos_grpsRRtgroupRi((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt
simpleVersions0		



(cCs
tdS(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 compared
           Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64
           The last _two_ pkgs will be returned, not just one of them. N(R.(R	tnaTupRaRb((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytreturnNewestByNameArchscCs
tdS(sreturn 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 version.N(R.(R	R=RaRb((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytreturnNewestByNamescCs
tdS(s,returns a list of pkg tuples (n, a, e, v, r)N(R.(R	RaRb((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt
simplePkgListscCs
tdS(N(R.(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt
printPackagesscCs
tdS(sDexclude incompatible arches. archlist is a list of compatible archesN(R.(R	tarchlist((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytexcludeArchsscCs
tdS(N(R.(R	tfieldstcriteria_reR3((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytsearchPackagesscCs
tdS(N(R.(R	targt
query_type((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt	searchAllscCsg}g}t|}i}x!|D]}tj|||<q%W|jd|}xKg|D]}|j^q^D]-}	|	\}
}}}
}t|
d|
|fd|
|
||fd|
|
fd|
|
|fd||
|
||fd|
||
||ff}x|jD]\}}||krS|j|j|	d|j|qxD|D]<}
||
rZ|j|j|	d|j|qZqZWqWqqWtj	|tj	|t
|fS(	s{take a list strings and match the packages in the sack against it
           this will match against:
           name
           name.arch
           name-ver-rel.arch
           name-ver
           name-ver-rel
           epoch:name-ver-rel.arch
           name-epoch:ver-rel.arch
           
           return [exact matches], [glob matches], [unmatch search terms]
           Ras%s.%ss%s-%s-%s.%ss%s-%ss%s-%s-%ss%s:%s-%s-%s.%ss%s-%s:%s-%s.%si(tsetRtcompile_patternRR;titemstappendR:tdiscardtuniqueR%(R	tpkgspecstmatchedt
exactmatcht	unmatchedtspecstptpkgsRR;RHRIRJRKRLRCttermtquery((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytmatchPackageNames	s4
#


c	CsAd}i}g}x|jd|D]u}|js=q(nx]|jD]R}||krit||<nt||dkrqGn||j|jqGWq(Wx|jd|D]}d}xZ||D]L}||krt||dks|j||kr|d7}PqqqW|dkr|j|qqW|S(sjreturns a list of package objects that are not required by
           any other package in this repositorycsshx|jD]}|Vq
Wx|jD]}|Vq#Wx|jD]}|Vq<Wx|jD]}|VqUWdS(s& Return all the provides, via. yield. N(tprovides_namestfilelisttdirlistt	ghostlist(RFtprov((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt_return_all_provides=s			R`ii(Rtrequires_namesRRtaddR=R(	R	R`RtreqtorphansRFRLtpreqR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytreturnLeafNodes9s,		)
N(NNN(NNN()RRt__doc__R
R R!R-R0R5R<RRBRRERGR:RPRRRSRTRURVRWRYRZR[R]R^R_RRfRvRxRyRzR{R}RRRR(((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR8sL																			
&						0tMetaSackcBsseZdZdZdZdZdZdZdZdZ	d!d!d!d!d!dZged	Z
d!d"d
Zd!d#dZdZd
ZdZdZedZdZdZdZdZd!d!edZdZd!d!edZd!d!edZd!edZdZdZdZ dZ!dZ"dZ#d Z$RS($sqRepresents the aggregate of multiple package sacks, such that they can
       all be treated as one unified sack.cCs#tj|i|_d|_dS(N(RR
tsacksRtcompatarchs(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR
ms
	cCs:d}x-t|jjD]}|t|7}qW|S(Ni(R'RtvaluesR(R	R$tsack((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR rscCs:x3|jjD]"}t|dr|jqqWdS(NtdropCachedData(RRR"R(R	R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRxscCs!||j|<|j|jdS(s1Adds a repository's packageSack to this MetaSack.N(RR0R(R	R`R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pytaddSack}s
cCs$|j|jj||||dS(N(RtidR5(R	R1R2R3R4((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR5scCs+x$|jjD]}|j|qWdS(N(RRR0(R	R/R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR0scCs&tjdtdd|jd|S(s5return a list of package objects by (n,a,e,v,r) tuples;packagesByTuple() will go away in a future version of Yum.
R6iR<(R7R8R9t_computeAggregateListResult(R	R;((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR<s	
cCs|jd|||||S(s6return list of pkgobjects matching the nevra requestedRB(R(R	R=R>R?R@RA((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRBscCs|jd||S(NRE(R(R	RCRD((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyREscCs|jd|||S(s5return dict { packages -> list of matching provides }RR(t_computeAggregateDictResult(R	R=RQRM((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRRscCs|jd|||S(s5return dict { packages -> list of matching requires }RS(R(R	R=RQRM((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRSscCs|jd|S(s<return list of package requiring the name (any evr and flag)RT(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRTscCs|jd|S(s<return list of package providing the name (any evr and flag)RU(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRUscCs|jd|S(sCreturn list of package conflicting with the name (any evr and flag)RV(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRVscCs|jd|S(s=return list of package obsoleting the name (any evr and flag)RW(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRWscs|s|jdS|jd}td|D}i}d}d	}d	}dfd}x~t|j|dtdD][}	|	d}
||
kr|||	rqn|
}|	}|	|kr||	||	<qqW|S(
sEreturns a dict of obsoletes dict[obsoleting pkgtuple] = [list of obs]RYcss|]}|dVqdS(iN((t.0tobstup((s3/usr/lib/python2.7/site-packages/yum/packageSack.pys	<genexpr>sR
cSsYt|d|d}|r!|St|d|d|df|d|d|dfS(s4 Compare two pkgtup's (ignore arch): n, a, e, v, r. iiii(R(R(txtyR$((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt_pkgtup_nevr_cmpscs||dkS(Ni((RR(R(s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt_pkgtup_nevr_eqsRDR(iN(RRRR'RER(R	RXtobsdictRCtnobsdictt	last_nametlast_pkgtlast_pkgtupRR;R=((Rs3/usr/lib/python2.7/site-packages/yum/packageSack.pyRYs(
	

cCs|jd|S(s#return list of packages by filenameR[(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR[scCsdS(saAdd a pkgobject to the packageSack.  This is a meaningless operation
           for the MetaSack.N((R	R\((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR]scCs(x!|jjD]}|jqWdS(sbuilds the useful indexes for searching/querying the packageSack
           This should be called after all the necessary packages have been
           added/deletedN(RRR^(R	R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR^scCs|jjj|dS(s2Delete a pkgobject if it exists in every sub-sack.N(R1RR_(R	R\((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR_scCs9|s|jdd||S|j|jd|d|S(sReturns a list of packages. Note that the packages are
           always filtered to those matching the patterns/case. An optional
           repoid allows you to easily get data for a specific repo. RRaRbN(RRRR(R	R`RaRb((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRs
	
cGsB|s%|j}|dd|||S|j|jd|||S(s Add an "excluder" for all packages in the repo/sack. Can basically
            do anything based on nevra, changes lots of exclude decisions from
            "preload package; test; delPackage" into "load excluder".
            Excluderid is used so the caller doesn't have to track
            "have I loaded the excluder for this repo.", it's probably only
            useful when repoid is None ... if it turns out utterly worthless
            then it's still not a huge wart. RfN(RRRRf(R	R`RcRdRetcalr((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRfs
	cCsf|j}|d|||}t|}|rb|s=|rbdj|pLg}td|n|S(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 compared.
           Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64
           The last _two_ pkgs will be returned, not just one of them. Rxs, sNo Package Matching %s(RtpackagesNewestByNameArchtjoinR(R	RwRaRbRRtui_pats((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRxs	cCso|jd|||}t|}|rk|s7|rk|rF|}ndj|pUg}td|n|S(sreturn 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 version.Rys, sNo Package Matching %s(RtpackagesNewestByNameRR(R	R=RaRbRR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRys	cCs|jd||S(s,returns a list of pkg tuples (n, a, e, v, r)Rz(R(R	RaRb((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRzs	cCs(x!|jjD]}|jqWdS(N(RRR{(R	R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR{#scCs+x$|jjD]}|j|qWdS(sDexclude incompatible arches. archlist is a list of compatible archesN(RRR}(R	R|R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR}'scCs|jd|||S(NR(R(R	R~RR3((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR,scCs|jd||S(NR(R(R	RR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR/sc	Csg}g}d}x|jjD]}t|dr"ggg}}}y|j|\}}}Wntk
r}q"nX|j||j||dkrt|}q|jt|}q"q"Wt	j
|}t	j
|}|dkrg}nt|}|||fS(NR(RRRR"RRtextendRtintersectionRRR%(	R	RRRRRRJtmtu((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR2s*


	cGsg}x~t|jjD]g}t||rt||}yt||}Wntk
riqnX|r|j|qqqW|S(N(R'RRR"tgetattrtapplyRR(R	t
methodNameRetresultRtmethodt
sackResult((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRMs
cGsi}x~t|jjD]g}t||rt||}yt||}Wntk
riqnX|r|j|qqqW|S(N(R'RRR"RRRR(R	RReRRRR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR\s
N(NNN(NNN(%RRRR
R RRR5R0R<RRBRRERRRSRTRURVRWRYR[R]R^R_RRfRxRyRzR{R}RRRRR(((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRisD											"				
							tPackageSackcBsveZdZdZdZddZdZdZd"d"d"d"d"dZ	ge
dZd"d#d	Zd"d$d
Z
dZdZd
ZdZdZe
dZdZdZdZdZdZdZdZdZdZdZd"d"e
dZd"d"e
dZd"d"e
dZ d"e
dZ!dZ"d Z#d!Z$RS(%s*represents sets (sacks) of Package ObjectscCsktj|i|_i|_i|_i|_i|_i|_i|_i|_	d|_d|_dS(Ni(
RR
tnevrat	obsoletestrequirestprovidest	conflictst	filenamest
pkgsByRepotpkgsByIDRRtindexesBuilt(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR
ns
									cCs5d}x(|jD]}|t|j|7}qW|S(Ni(RR(R	R$R1((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR sterrorcCsA|js=|dkr!tdq=|dkr=|jq=ndS(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(RRR^(R	tfailure((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt
_checkIndexess
	cCs|jdS(s* Do nothing, mainly for the testing code. N(tclearIndexes(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRscCs
||_dS(N(R(R	R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR0sc
Cs?|jdd|||||f|jkrH|j|||||fS|dk	r{|jj|ddddfg}n-g}x$|jjD]}|j|qWg}x|D]}	|r||	jks|r||	jks|r||	j	ks|r||	j
ks|r*||	jkr*qn|j|	qW|S(s6return list of pkgobjects matching the nevra requestedRRN(
RRRtgetRt
itervaluesRR=R>R?R@RAR(
R	R=R>R?R@RARt
pkgsbyRepoRRF((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRBs$'
cCs|jddg}t}xX|D]P}||kr>q&n|j||j|jj|ddddfgq&W|rg|D]}|j^qS|S(s6return list of pkgobjects matching the names requestedRRN(RRRRRRRR;(R	RCRDRtdoneR=R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyREs	

/cCs|jdd|dkr%d}n6t|ttdtfkr[tjj|}ni}xK|jj	|gD]4}|j
d|||f}|rw|||<qwqwW|ddkr|ddf}x3|j|D]}|j|gj
|qWn|S(	s5return dict { packages -> list of matching provides }RRRit/N(NNN(NNN(RRRRtunicodetrpmUtilst	miscutilststringToVersionRRt
matchingPrcosR[RgR(R	R=RQRMRRFthitsthit((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRRs	! cCs|jdd|dkr%d}n6t|ttdtfkr[tjj|}ni}xK|jj	|gD]4}|j
d|||f}|rw|||<qwqwW|S(s5return dict { packages -> list of matching requires }RRRN(NNN(RRRRRRRRRRR(R	R=RQRMRRFR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRSs	!cCs|jddt||}tj|\}}\}}}g}	g}
||krl|	j||nxB|	D]:}|j||||||ffrs|
j|qsqsW|dkr|
Stj|s|
S|
j|j|tj	|
S(NRRR(
RRRtstring_to_prco_tupleRt	checkPrcoRtre_filenameR[R(R	R=tprcotypetprcodictRHtfRJRKRLt
basic_resultstresultsRF((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt
searchPrcos !
$cCs|j|dS(s3return list of package requiring the item requestedR(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRTscCs|j|dS(s3return list of package providing the item requestedR(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRUscCs|j|dS(s6return list of package conflicting with item requestedR(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRVscCs|j|dS(s4return list of package obsoleting the item requestedR(R(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRWscCsi}xN|jD]@}t|jdkr4qn|j|jgj|jqW|sa|Std|jD}g}x*|D]"}||kr|j|qqWx|D]
}||=qW|S(sEreturns a dict of obsoletes dict[obsoleting pkgtuple] = [list of obs]icss|]}|jVqdS(N(R;(RR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pys	<genexpr>s(	RRRRgR;RRRyR(R	RXtobsRFtnewest_tupsttogoR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRY	s#

cCstS(sb Is calling pkg.returnFileEntries(primary_only=True) faster than
            using searchFiles(). (R(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRZ#scCs2|jdd||jkr*|j|SgSdS(s& Return list of packages by filename. RRN(RR(R	R=((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR[(scCs.||krg||<n||j|dS(N(R(R	tdicttkeytdata((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt_addToDictAsList0s
cCs]||krdSy||j|Wntk
r8nXt||dkrY||=ndS(Ni(tremovet
ValueErrorR(R	RRR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt_delFromListOfDict7s
cCsp|j}|j\}}}}}|js:||jkrS|j|j||n|jrl|j|ndS(s"add a pkgobject to the packageSackN(R`R;RRRRt_addPackageToIndex(R	R\R`R=RAR>R?R@((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR]Cs		cCsP|jx6|jD]+}x"|j|D]}|j|q(WqWd|_dS(sbuilds the useful indexes for searching/querying the packageSack
           This should be called after all the necessary packages have been 
           added/deletediN(RRRR(R	R`R\((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR^Ns

cCsLi|_i|_i|_i|_i|_i|_i|_d|_dS(Ni(RRRRRRRR(R	((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR[s							cCsx?|jdD].\}}\}}}|j|j||qWx?|jdD].\}}\}}}|j|j||qRWx?|jdD].\}}\}}}|j|j||qWx?|jdD].\}}\}}}|j|j||qWxD|jD]6}x-|j|D]}|j|j||q+WqW|j|j	|j
||j\}	}
}}}
|j|j|	|||
|
f||j|j|	ddddf|dS(NRRRR(t
returnPrcoRRRRRtreturnFileTypestreturnFileEntriesRRRR;RR(R	R\RHtflRJRKRLtftypetfileR=RAR>R?R@((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRgs((((%cCsx?|jdD].\}}\}}}|j|j||qWx?|jdD].\}}\}}}|j|j||qRWx?|jdD].\}}\}}}|j|j||qWx?|jdD].\}}\}}}|j|j||qWxD|jD]6}x-|j|D]}|j|j||q+WqW|j|j	|j
||j\}	}
}}}
|j|j|	|||
|
f||j|j|	ddddf|dS(NRRRR(RRRRRRRRRRRR;RR(R	R\RHRRJRKRLRRR=RAR>R?R@((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt_delPackageFromIndexzs((((%cCs6|j|j|j||jr2|j|ndS(sdelete a pkgobjectN(RRR`RR(R	R\((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR_s	cCsg}|dkr=xM|jD]}|j|j|qWn%y|j|}Wntk
ranX|rt|||dd}|d|d}n|S(s2return list of all packages, takes optional repoidRsrepo-pkgkeyiiN(RRRtKeyErrorR(R	R`RaRbt
returnListR1((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRs
	cCs)i}|rZ|jdd|jj|dddddf}|srtd|qrn|jd|d|}x}|D]u}|j|jf|kr|||j|jf<qy||j|jf}|j|ry|||j|jf<qyqyW|r||kr||gStd|n|j	S(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 compared
           Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64
           The last _two_ pkgs will be returned, not just one of them. RRisNo Package Matching %s.%sRaRbN(
RRRRRRR=RAtverGTR(R	RwRaRbthighdicttwhereRtpkg2((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRxs&	%	
cCs@i}|dkr3|dk	r3|jd|}n|jd|d|}x|D]}|j|krz|g||j<qR||jd}|j|r|g||j<n|j|rR||jj|qRqRW|r||kr||Std|ng}x2|jD]$}	x|	D]}
|j|
q!WqW|S(sreturn 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 version.R=RaRbisNo Package Matching  %sN(	RRBRR=RtverEQRRR(R	R=RaRbRRRRt
returnlisttpolstRF((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRys,	

cCs,g|jd|dtD]}|j^qS(sLreturns a list of pkg tuples (n, a, e, v, r) optionally from a single repoidRaRb(RRR;(R	RaRbR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRzscCs x|jD]}|GHq
WdS(N(R(R	R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR{scCs:x3|jD]%}|j|kr
|j|q
q
WdS(sDexclude incompatible arches. archlist is a list of compatible archesN(RRAR_(R	R|R((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR}sc	Csi}x|jD]}g}xB|D]:}t||}|r&|j|r&|j|q&q&Wt|dkr|r|||n|||<qqW|S(Ni(RRtsearchRR(	R	R~RR3tmatchesRFt	tmpvaluestfieldtvalue((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRs
N(NNN(NNN(%RRRR
R RRR0RRBRRERRRSRRTRURVRWRYRZR[RRR]R^RRRR_RRxRyRzR{R}R(((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRlsD		
													
				$$		cCsi}x|D]w}|j}d}||krH|j||d}n|dkrd|g||<q
|dkr
||j|q
q
Wg}x!|jD]}|j|qW|S(st Does the same as PackageSack.returnNewestByName().
        Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64ii(R=tverCMPRRR(RRXRRtcvalR$tvals((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyRs
	cCsbi}xO|D]G}|j|jf}||krJ|j||rJq
n|||<q
W|jS(sz Does the same as PackageSack.returnNewestByNameArch()
        The last _two_ pkgs will be returned, not just one of them.(R=RAtverLER(RRXRR((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR"s
tListPackageSackcBs#eZdZddZdZRS(sDerived class from PackageSack to build new Sack from list of
       pkgObjects - like one returned from self.returnNewestByNameArch()
       or self.returnNewestByName()cCs-tj||dk	r)|j|ndS(N(RR
RtaddList(R	tObjlist((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR
2s
cCs"x|D]}|j|qWdS(N(R](R	tObjListtpkgobj((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR7s
N(RRRRR
R(((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyR
-s(RtErrorsRR7tretfnmatchRtpackagesRtrpmUtils.miscutilsRRRtobjectRRRRRR
(((s3/usr/lib/python2.7/site-packages/yum/packageSack.pyt<module>s$2		

OHA YOOOO