MINI MINI MANI MO

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


[c@sddlZddlZddlZddlZddlZddlZddlmZddlZ	ddl
mZ
dfdYZdfdYZ
dfd	YZdS(
iN(tMetaSack(tproxyt_wrap_ayum_getKeyForRepocBs&eZdZedZddZRS(sc This is a wrapper for calling YumBase.getKeyForRepo() because
        otherwise we take a real reference through the bound method and
        that is d00m (this applies to YumBase and RepoStorage, hence why
        we have a separate class).
        A "better" fix might be to explicitly pass the YumBase instance to
        the callback ... API change! cCst||_||_dS(N(tweakreftayumtca(tselfRR((s-/usr/lib/python2.7/site-packages/yum/repos.pyt__init__$scCs/|jr|jj||S|jj||S(N(RRtgetCAKeyForRepot
getKeyForRepo(Rtrepotcallback((s-/usr/lib/python2.7/site-packages/yum/repos.pyt__call__'s	N(t__name__t
__module__t__doc__tFalseRtNoneR(((s-/usr/lib/python2.7/site-packages/yum/repos.pyRstRepoStoragecBseZdZdZdZddZdZdZdZ	dZ
dZd	Zd
Z
eedZdZd
ZdZdZdZdZddZdZdZdZdZdddddZRS(sXThis class contains multiple repositories and core configuration data
       about them.cCsi|_d|_d|_t|_tjd|_t	|_
t||_t
||_t
|dt|_d|_g|_i|_t	|_dS(Nisyum.RepoStorageR(treposRRtcacheRtpkgSacktloggingt	getLoggertloggerRt_setupRRRtgpg_import_functTruetgpgca_import_functconfirm_funct_cache_enabled_repostquick_enable_disablet_list_enabled_hasrun(RR((s-/usr/lib/python2.7/site-packages/yum/repos.pyR0s							c	CsttjdsdSg}x|jD]}|jr>q)ny|joV|j|}Wn;tjk
r}|j	s~n|j
|jt}nX|r)|j
}|j|}|j||tgfq)q)WxttfD]}xk|D]c\}}}|d}	xE|D]=\}
}|
jdk|kr|j|dtd|	qqWqWtjjqWx;|D]3\}}}|dr|jqr|j|qrWdS(sX Download metadata for all enabled repositories,
            based on mdpolicy.
        t
parallel_waitNcSst|d<dS(Ni(R(tobjterror((s-/usr/lib/python2.7/site-packages/yum/repos.pytfailfuncfstasyncR$i(thasattrt
urlgrabbertgrabbertlistEnabledRt_asynct_commonLoadRepoXMLtErrorst	RepoErrortskip_if_unavailabletdisableRepotidRt_mdpolicy2mdtypest_commonRetrieveDataMD_listtappendRtsizeRt_retrieveMDR!t_revertOldRepoXMLt_commonRetrieveDataMD_done(RRR
tdltetmdtypestdownloadingtno_sizeR#R$tndatatnmdtype((s-/usr/lib/python2.7/site-packages/yum/repos.pyt
retrieveAllMDKs8		
 $

c	
Cs|dkr|jn|jjjd|dkrG|j}n|j|}t|dkr{|jjdnt	t
jdri}x{|jD]j}|jrt
jj|j}|j||}|j|jkr
d}tj|||fq
qqWnx|D]}|j|jjj|jjd|jd|jd|j|jst|j|jqt|jjd	d}|r||_qqWt|_ |j!|jjjd
dS(Ntprereposetupis#No Repositories Available to Set Uptpycurls/sslclientcert basename shared between %s and %sRRRtdownloaddirt
postreposetup("RR)Rtpluginstrunt	findRepostlenRtdebugR&R'R(t
sslclientcerttostpathtbasenamet
setdefaultR,tConfigErrortsetuptconfRtmediagrabberRRRtenabledR/R0tgetattrtpkgdirRRR?(	RtthisrepoRtcert_basenamesR
tbntothertmsgRT((s-/usr/lib/python2.7/site-packages/yum/repos.pytdoSetupts:
	#

		
cCst|jjS(N(tstrRtkeys(R((s-/usr/lib/python2.7/site-packages/yum/repos.pyt__str__scCsWy|jWnBtjk
rR}|jjdt|t||jfnXdS(NsException %s %s in %s ignored(tcloseR,R-RRHtreprR[t__del__(RR9((s-/usr/lib/python2.7/site-packages/yum/repos.pyR`scCs(x!|jjD]}|jqWdS(N(RtvaluesR^(RR
((s-/usr/lib/python2.7/site-packages/yum/repos.pyR^scCs|j|jkr(tjd|jn||j|j<t|dri|jj|j|j|_n	d|_t|j	dst
|_n|j	j|_dS(Ns;Repository %s is listed more than once in the configurationRt_override_sigchecks(R0RR,tDuplicateRepoErrorR&RtupdateRRRRRb(Rtrepoobj((s-/usr/lib/python2.7/site-packages/yum/repos.pytadds	cCs7||jkr3|j|}|j|j|=ndS(N(RR^(RtrepoidRU((s-/usr/lib/python2.7/site-packages/yum/repos.pytdeletes

cCs|jj}|j|S(N(RRatsort(Rtrepolist((s-/usr/lib/python2.7/site-packages/yum/repos.pyRis
cCs9y|j|SWn#tk
r4}tjd|nXdS(Ns:Error getting repository data for %s, repository not found(RtKeyErrorR,R-(RRgR9((s-/usr/lib/python2.7/site-packages/yum/repos.pytgetRepos
c	Cs||jkr|j|gSg}x|jdD]}|j}tj|j|}xs|jjD]b\}}||jkst||r|j|qm|rm||j	rm|j|qmqmWq3W|S(s Find all repositories matching fnmatch `pattern` on the repo.id,
            can also do case insensitive searches and/or search on the name.t,(
Rtsplittstriptmisctcompile_patterntitemsR0tAssertionErrorR3tname(	Rtpatternt
name_matchtignore_casetresulttitemtmatchRtR
((s-/usr/lib/python2.7/site-packages/yum/repos.pyRFscCsg}tj|s*|jddkrax]|j|D] }|j|j|jq:Wn)|j|}|j|j|j|S(sdisable a repository from use
        
        fnmatch wildcards may be used to disable a group of repositories.
        returns repoid of disabled repos as list
        Rmi(Rptre_globtfindRFR3R0tdisableRl(RRgRR
RU((s-/usr/lib/python2.7/site-packages/yum/repos.pyR/s$
cCsg}tj|s*|jddkrax]|j|D] }|j|j|jq:Wn)|j|}|j|j|j|S(senable a repository for use
        
        fnmatch wildcards may be used to enable a group of repositories.
        returns repoid of enables repos as list
        Rmi(RpR{R|RFR3R0tenableRl(RRgRR
RU((s-/usr/lib/python2.7/site-packages/yum/repos.pyt
enableRepos$
cCs|js(|jjjdt|_n|jdk	rH|jrH|jSg}x3|jj	D]"}|j
r^|j|q^q^W|j|jdk	r||_|jj
n|S(s#return list of enabled repo objectstprelistenabledreposN(R RRDRERRRRRRat	isEnabledR3Ritclear(Rt
returnlistR
((s-/usr/lib/python2.7/site-packages/yum/repos.pyR)s	

	cCs:g}x-|jD]}|jr|j|qqW|S(s6return a list of repo objects that have groups enabled(R)tenablegroupsR3(RRR
((s-/usr/lib/python2.7/site-packages/yum/repos.pytlistGroupsEnableds
	cCs0||_x |jjD]}||_qWdS(ssets cache value in all reposN(RRRa(RtcachevalR
((s-/usr/lib/python2.7/site-packages/yum/repos.pytsetCache(s	cCsN||_x>|jjD]-}||jkr|j|_||_qqWdS(s$sets the cachedir value in all reposN(t	_cachedirRRatbasecachedirtold_base_cache_dir(RtcachedirR
((s-/usr/lib/python2.7/site-packages/yum/repos.pytsetCacheDir.s
	cCs.x'|jjD]}|j||qWdS(s6sets the progress bar for downloading files from reposN(RRatsetCallback(RR"t	multi_objR
((s-/usr/lib/python2.7/site-packages/yum/repos.pytsetProgressBar8scCs+x$|jjD]}|j|qWdS(s'sets the failure callback for all reposN(RRat
setFailureObj(RR"R
((s-/usr/lib/python2.7/site-packages/yum/repos.pytsetFailureCallback>scCs+x$|jjD]}|j|qWdS(s)sets the failure callback for all mirrorsN(RRatsetMirrorFailureObj(RR"R
((s-/usr/lib/python2.7/site-packages/yum/repos.pytsetMirrorFailureCallbackDscCs+x$|jjD]}|j|qWdS(N(RRatsetInterruptCallback(RRR
((s-/usr/lib/python2.7/site-packages/yum/repos.pyRJscCs|jS(N(R(R((s-/usr/lib/python2.7/site-packages/yum/repos.pytgetPackageSackNsRRtmetadataicCs|js|jn|s(|j}ng}|dkrI|j}n|dkrg|jj}nt|tjkrx|D]A}t	|t
r|j|q|j|}|j|qWn4t|tj
kr|j|}|j|n|dkrdddg}n	|g}ttjdrxE|D]=}|jrTq?n|jr?|j}	|	j||q?q?Wtjjnx|D]}|j}	y|	j||||Wntk
r2}
|
jdjdsn|d
kr|jr|j|jqtj|
jdqtjk
rr}
|dkrl|jrl|j|jqqX|jj |j|	qWd	S(s
        This populates the package sack from the repositories, two optional 
        arguments:
            - which='repoid, enabled, all'
            - mdtype='metadata, filelists, otherdata, all'
        RRtallRt	filelistst	otherdataR!itParsingN(sallR(sallR(!RRZRR)RRattypettypestListTypet
isinstancet
RepositoryR3Rlt
StringTypeR&R'R(RR*Rt_retrieve_asyncR!tpopulatet	TypeErrortargst
startswithR.R/R0R,R-RtaddSack(RtwhichtmdtypeRt	cacheonlytmyreposR
trepobjtdatatsackR9((s-/usr/lib/python2.7/site-packages/yum/repos.pytpopulateSackRsX	

	
		
N(R
RRRR?RRZR]R`R^RfRhRiRlRRFR/RR)RRRRRRRRR(((s-/usr/lib/python2.7/site-packages/yum/repos.pyR,s0		),														
				RcBseZdZdZdZdZdZdZdZe	eZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZddedZddedZRS(s#this is an actual repository objectcCs)||_i|_|jt|_dS(N(R0RR}Rt_xml2sqlite_local(RRg((s-/usr/lib/python2.7/site-packages/yum/repos.pyRs		
cCs4|j|jkrdS|j|jkr,dSdSdS(sf Sort base class repos. by alphanumeric on their id, also
            see __cmp__ in YumRepository(). iiiN(R0(RRX((s-/usr/lib/python2.7/site-packages/yum/repos.pyt__cmp__s
cCs|jS(N(R0(R((s-/usr/lib/python2.7/site-packages/yum/repos.pyR]scCs
t|jS(N(thashR0(R((s-/usr/lib/python2.7/site-packages/yum/repos.pyt__hash__scCsWy|jWnBtjk
rR}|jjdt|t||jfnXdS(NsException %s %s in %s ignored(R^R,R-RRHR_R[R`(RR9((s-/usr/lib/python2.7/site-packages/yum/repos.pyR`scCs|jS(s1 Show self.id, so we can use it and override it. (R0(R((s-/usr/lib/python2.7/site-packages/yum/repos.pyt_ui_idscCsdS(N((R((s-/usr/lib/python2.7/site-packages/yum/repos.pyR^scCst|||dS(s+sets a generic attribute of this repositoryN(tsetattr(Rtkeytvalue((s-/usr/lib/python2.7/site-packages/yum/repos.pytsetAttributescCst||dS(N(RSR(RR((s-/usr/lib/python2.7/site-packages/yum/repos.pytgetAttributescCs|jd}|dk	o|S(NRR(RR(RRR((s-/usr/lib/python2.7/site-packages/yum/repos.pyRscCs$|jddt|j|j<dS(NRRi(RRRR0(R((s-/usr/lib/python2.7/site-packages/yum/repos.pyR~scCs$|jddt|j|j<dS(NRRi(RRRR0(R((s-/usr/lib/python2.7/site-packages/yum/repos.pyR}scCs|jd}|pgS(Ntexclude(R(RtexcludeList((s-/usr/lib/python2.7/site-packages/yum/repos.pytgetExcludePkgListscCs|jd}|pgS(Ntincludepkgs(R(RtincludeList((s-/usr/lib/python2.7/site-packages/yum/repos.pytgetIncludePkgListscCs
tdS(N(tNotImplementedError(R((s-/usr/lib/python2.7/site-packages/yum/repos.pytreadyscCs
tdS(N(R(R((s-/usr/lib/python2.7/site-packages/yum/repos.pytgetGroupLocationscCs
tdS(N(R(R((s-/usr/lib/python2.7/site-packages/yum/repos.pyRscCs
tdS(N(R(RR((s-/usr/lib/python2.7/site-packages/yum/repos.pyROscCs
tdS(N(R(RR((s-/usr/lib/python2.7/site-packages/yum/repos.pyRscCs
tdS(N(R(RR"((s-/usr/lib/python2.7/site-packages/yum/repos.pyRscCs
tdS(N(R(RR"((s-/usr/lib/python2.7/site-packages/yum/repos.pyRscCs
tdS(N(R(Rtpackaget	checkfuncttextR((s-/usr/lib/python2.7/site-packages/yum/repos.pyt
getPackagestsimplecCs
tdS(N(R(RRRtregetR((s-/usr/lib/python2.7/site-packages/yum/repos.pyt	getHeadersN(R
RRRRR]RR`Rtpropertytui_idR^RRRR~R}RRRRRRORRRRRRR(((s-/usr/lib/python2.7/site-packages/yum/repos.pyRs2		
																			(treRRRpRJR,tpackageSackRturlgrabber.grabberR'RRRRR(((s-/usr/lib/python2.7/site-packages/yum/repos.pyt<module>sh

OHA YOOOO