KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/yum/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/yum/yumRepo.pyo
m
Pc@sdkZdkZdkZdkZdkZeiiddkZdkl	Z	dkl
Z
dkZdkl
Z
dkZdkZdklZdkZdkZdkZdklZdklZdkTdkZyd	klZeZWnej
o
eZnXdk Z dk!Z!dk"Z"dk#Z#dk$Z$dk%Z%dk&Z&dk'Z'eZ(e"i)d
ei*e i+dZ,e i+dZ-d
ei.fdYZ/deei0fdYZ1e2dZ3dS(Ntmedia(s
URLGrabber(sdefault_grabber(sURLGrabError(s
Repository(sconfig(smisc(t*(sSSLtignores	yum.Repossyum.verbose.RepostYumPackageSackcBsYtZdZdZdZdZedZdeddZdZ	d	Z
RS(
s;imports/handles package objects from an mdcache dict objectcCs&tii|||_h|_dS(N(tpackageSacktPackageSackt__init__tselftpackageClasstpctadded(RR((t//usr/lib/python2.4/site-packages/yum/yumRepo.pyRIs	cCs|idS(N(Rtclose(R((Rt__del__NscCs
h|_dS(N(RR
(R((RRQsc
Cs|ii|o ||i|jodSq3nt|}|djod}x~|D]v}|d7}|o|i|||n||}|i
||}	||	_|i|i||	|i|	qYW|ii|pg|i|<n|i|idd|_n|ddgjo|ii|o5d|i|jotid||ifqsnd}x||D]t}|d7}|o|i|||n||}|ii|o)x&|i|D]}	|	i|qWqqW|i|i|d|_ndS(Ntmetadataiit	filelistst	otherdatas$%s md for %s imported before primary(RR
thas_keytrepotdatatypetlentdataobjttotaltcurrenttpkgidtcallbacktprogressbartpkgdictR	tpotidt_addToDictAsListtpkgsByIDt
addPackagetappendtindexesBuilttErrorst	RepoErrortimportFromDict(
RRRRRRRRRR((RtaddDictTsJ


	
!

RicCs\|djodddg}
n
|g}
t|dp+tid|id|id||_	nx|
D]}|ii
|o||i|joqkqnd}|djo%d	}
d
}|i}|i	i}	nh|djo%d}
d}|i}|i	i}	n6|djo%d}
d
}|i}|i	i}	nqk|i||
o|i||
}|pm|i|
}|oS|idd}|ip3t i!||t i"||i||
}qqn|i	i#|}n:|}|i&i'|}|i)\}}|	||}|p|i-||||n~qkW|`	dS(NtallRRRtcacheHandlertstoredirtrepoidRt
primary_dbtprimarytfilelists_dbtother_dbtothers.bz2t(.tmdtypetdatathasattrRtsqlitecachectRepodataParserSqlitetcachedirRRR(titemRR
RtNonetdb_fntmydbtypetmymdtypet
getPrimaryXMLtrepo_get_functiont
getPrimarytrepo_cache_functiontgetFileListsXMLtgetFileliststgetOtherXMLtgetOtherdatat_check_db_versiont_check_uncompressed_dbtdb_un_fnt_retrieveMDtreplacetcachetmisct
bunzipFiletunlink_ft
open_databasetdobjtxmltrepoXMLtgetDatatxmldatatchecksumtctypetcsumt	cacheonlyR&(RRR1RRVR9RRRUROR?R:RTR=R2R;RFRNR7((Rtpopulates`
		
	
	
	

	c
Cs|ii|}|i\}	}ti	i
|}|id|}|idd}d}|iti	i
|ti	i|onto|io|Sny|i||dtWn.tj
o"|ipti|qqX|}n|S(s8return file name of uncompressed db is good, None if nott/s.bz2R0topenchecksumN(RRPRQR1tmydbdatatlocationtr_basetremotetostpathtbasenametfnameR6tbz2_fnRHRFR8tresultt_preload_md_from_system_cachetexiststskip_old_DBMD_checkt
_using_old_MDtcheckMDtTruetURLGrabErrorRIRJRL(
RRR1R]RFRbRcRaRZR\((RREs$

cCs
|i|S(N(RRDR1(RRR1((RRDs(t__name__t
__module__t__doc__RR
RR8R&RWRERD(((RRGs			,H	t
YumRepositorycBswtZdZdZdZdZeeZdZdZ	dZ
ee
ZdZdZ
d	Zd
Zdded
ZdZdZdZdZdZedZdZdZedZdZdZedZedZdZ dZ!dZ"dZ#edZ$ed d!Z%ed"d#Z&ed$d%Z'ed&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.ed-d.d/d0d1d2Z/d3Z0ed-d4d/d5d1d6Z1e2e2e2e2e2e2e2e2d7ed8
Z3e3Z4e2e2ed9Z5e2d7ed:Z6d;Z7d<Z8d=Z9d>Z:e2e2e2d?Z;d@Z<e2e2dAZ=e2dBZ>dCZ?dDZ@dEZAe2dFZBedGZCdHZDeEdIZFe2e2dJZGdKZHe2dLZIe2dMZJedNZKe2dOZLe2dPZMe2e2dQZNe2dRZOdSZPed-dTd/dUd1dVZQdWZRedXZSee2edYZTdZZUed[ZVd\ZWd]ZXd^ZYd_ZZd`Z[daZ\dbZ]dcZ^e2ddZ_deZ`dfZadge2dhZbdiZcdjZdRS(kso
    This is an actual repository object

    Configuration attributes are pulled in from config.RepoConf.
    cCstii|ti||d|_g|_d|_	d|_
d|_d|_d|_
h|_d|_d|_h|_h|_d|_d|_d|_t|_h|_d|_t|_d|_d|_d|_d|_d|_d|_ hdd<dd<d	d<d
d<dd<|_!d|_"d|_#d|_$d|_%t|_&d|_'d|_(d|_)t*|_+d|_,d|_-d|_.dS(Nis
yumgroups.xmlsrepodata/repomd.xmltcachecookieR0iR,RR/tgroupt
updateinfo(/tconfigtRepoConfRRt
RepositoryR*R8trepofilet_urlstenablegroupstgroupsfilenamet
repoMDFilet_repoXMLRgt_oldRepoMDDataRItmirrorlistparsedtyumvart_proxy_dicttmetadata_cookie_fnt_metadataCurrentt	_metalinktFalsetgroups_addedthttp_headerst	sslcacertt	sslverifyt
sslclientcerttsslclientkeytrepo_config_agetbasecachedirtcostt
copy_localt	retrievedRtfailure_objtmirror_failure_objtinterrupt_callbackt_callbacks_changedt	mediafunctgpg_import_functconfirm_funcRittimestamp_checkt_sackt	_grabfunct_grab(RR*((RRsP																									6											cCsl|djodSnt|do
|i}nd}t|i|}|o|Snt|i|iS(s@ Sort yum repos. by cost, and then by alphanumeric on their id. iRiN(	R/R8R3RtocosttcmpRtretR(RR/RR((Rt__cmp__&s

cCs0|idjotiti|_n|iS(N(RRR8t
sqlitesacktYumSqlitePackageSacktYumAvailablePackageSqlite(R((Rt_getSack3scCs2|idj	o|iinti|dS(N(RRR8tsackRRt(R((RR?scCs
d|_dS(N(R8RR(R((Rt
_resetSackDscCs#|i|io|iSndS(N(RtdoProxyDictR~R8(R((Rt__getProxyDictGs

cCs|iS(s7Returns the instance of this repository's package sack.N(RR(R((RtgetPackageSackQscCs%t|do|idj	SntS(s;Returns true if this repository is setup and ready for use.tmetadata_cookieN(R3RRPR8R(R((RtreadyVscCsEd|iijo|iid}n|iid}|iS(s"Returns the location of the group.tgroup_gzRpN(RRPt	fileTypesRQtthisdataR[(RR((RtgetGroupLocation]s
cCs|iS(N(RR(R((Rt__str__esiicCs[yti|||SWn=titfj
o(}|odSntid|nXdS(stakes filename, hand back Checksum of it
           sumtype = md5 or sha
           filename = /path/to/file
           CHUNK=65536 by defaults#Error opening file for checksum: %sN(RJRStsumtypetfiletCHUNKR#t	MiscErrortEnvironmentErrortetchecksum_can_failR8R$(RRRRRR((Rt	_checksumhscCsd|i}dddddddd	d
ddd
dddddddddg}|ix+|D]#}|d|t||f}qcW|d}x|iD]}|d|}qW|S(Ns[%s]
tnamet	bandwidthtenabledRwtgpgcheckt
repo_gpgchecktincludepkgst	keepalivetproxytproxy_passwordtproxy_usernametexcludetretriestthrottlettimeoutt
mirrorlisttmetalinkR6tgpgkeytpkgdirthdrdirs%s = %s
s	baseurl =s %s
(	RRtoutputtvarstsorttattrtgetattrturlsturl(RRRRR((Rtdumpts
E
!

cCsv|iyti|ddgWnKtj
o?}|itijo|ii	|qrtt
|nXdS(s%Persistently enables this repository.tonlyRN(RtenableRrtwriteRawRepoFiletIOErrorRterrnotEACCEStloggertwarningtstr(RR((RtenablePersistents
cCsv|iyti|ddgWnKtj
o?}|itijo|ii	|qrtt
|nXdS(s&Persistently disables this repository.RRN(RtdisableRrRRRRRRRR(RR((RtdisablePersistents
cCs<t|idjo"|iotid|indS(shself-check the repo information  - if we don't have enough to move
           on then raise a repo erroris(Cannot find a valid baseurl for repo: %sN(RRRvtmediaidR#R$R(R((Rtchecks!cCsA|iodSnh|_d}|iddgjod|i}|idj	oti|idd}|d}|d}|ddjo
d}n|dd|d	}d
||i||f}|idj	o#d||i|i||f}qqn|dj	o+||id<||id
<||id<ndS(Nt_none_s%stallow_fragmentsiiiR0t?is%s://%s@%s%ss%s://%s:%s@%s%sthttpthttpstftp(
RR~R8tproxy_stringRRturlparseturlsplittproxy_parsedtproxy_protot
proxy_hostt
proxy_restR(RRRRRR((RRs(
	



+


cCs`g}x+|iD] }|i||i|fqW|p
d|ijp|idn|S(sAConvert our dict of headers to a list of 2-tuples for urlgrabber.tPragmasno-cacheN(Rsno-cache(theadersRRtkeyR!RI(RRIRR((Rt__headersListFromDicts
cCs'tidtidd|idS(Ns5setupGrab() will go away in a future version of Yum.
t
stackleveli(twarningstwarnR#tYumFutureDeprecationWarningRt
_setupGrab(R((Rt	setupGrabs	cCs|idjotii}n
tii}|i}t	d|i
d|id|id|i
dd||_||i|id|i|_dS(	s_sets up the grabber functions with the already stocked in urls for
           the mirror groupst
roundrobintprogress_objtfailure_callbackRRtregettsimpleN(Rtfailovermethodt
urlgrabbertmirrort
MGRandomOrdertmgclasstMirrorGroupt_default_graboptstugoptst
URLGrabberRRRRRRRR(RRR((RRs			cCshd|i<d|i<d|i<d|i<d|i<d|i<dt|id|<d	|i
<d
tii
<}|S(NRRtretryRtproxiesRRRItssl_contextt
user_agent(RRRRRt
proxy_dictRttuplet#_YumRepository__headersListFromDictRIt_getSslContexttdefault_grabbertoptsR(RRIR((RRs
cCs3|ip
|io|it|_n|iS(N(RRRRR(R((Rt_getgrabfuncs

cCs3|ip
|io|it|_n|iS(N(RRRRR(R((Rt_getgrabs

cCs
|iS(N(RR
(R((Rt<lambda>scCs
|iS(N(RR(R((RRscCstii|otii|odSn|iotid|nyti	|ddWn7t
j
o+}dd|d|f}ti|nXdS(s@make the necessary directory path, if possible, raise on failureNsCannot access repository dir %stmodeis
%s: %s %s: %ssError making cache directorys	error was(
R^R_RetdpathtisdirRRIR#R$tmakedirstOSErrorRtmsg(RRRR((Rt_dirSetupMkdir_ps&
cCstii|i|i}tii|d}tii|d}|i	d||i	d||i	d||i	d|id|id|i
}|i	d	|x'|i|igD]}|i
|qW|id
|id|id|id
dS(s6make the necessary dirs, if possible, raise on failuretpackagesRt_dir_setup_cachedirt_dir_setup_pkgdirt_dir_setup_hdrdirt_dir_setup_gpgdirs/gpgdirRXt_dir_setup_metadata_cookies
repomd.xmlRosmirrorlist.txtsmetalink.xmlN(R^R_tjoinRRRR6RRtsetAttributeRtcookietdirRRd(RRR6RRR ((RtdirSetups"


cCs5d|}t||p|int||S(s; Make the directory attributes call .dirSetup() if needed. t_dir_setup_N(RR3RR!R(RR((Rt_dirGetAttr(s

cCsd|}t||p|in|djo:t|dp
g|_n|iit||nt|||}|djo|i
|n|S(s; Make the directory attributes call .dirSetup() if needed. R"Rt_old_pkgdirsN(s_dir_setup_pkgdir(RR3RR!R$R!RtsetattrtvalRR(RRR&R((Rt_dirSetAttr.s



cCs
|idS(NR6(RR#(R((RR=scCs
|idS(NR(RR#(R((RR>scCs|id|S(NR(RR'tx(RR(((RR?scCs
|idS(NR(RR#(R((RR@scCs|id|S(NR(RR'R((RR(((RRAscCs
|idS(Ntgpgdir(RR#(R((RRBscCs|id|S(NR)(RR'R((RR(((RRCscCs
|idS(NR(RR#(R((RRDscCs'tidtidd|idS(Ns8baseurlSetup() will go away in a future version of Yum.
Ri(RRR#RRt
_baseurlSetup(R((RtbaseurlSetupFs	cCsU|iodSn|ipdSn|iiddjodSn|i|_dS(NRi(RRRtfind(R((Rt_hack_mirrorlist_for_anacondaKs

cCs|i|i|_|i|_g}|i|io4|io)|it	|i
it|_n|i
o+|io |i|it|_n|i||_|i|i|_t|idjot|doxtii|iob|ipTyti|iWn-ttfj
o}d|i|fGHqcXd|iGHqgqkn|i|_|idS(sgo through the baseurls and mirrorlists and populate self.urls
           with valid ones, run  self.check() at the end to make sure it workeditmirrorlist_files-Could not delete bad mirrorlist file: %s - %ss-removing mirrorlist with no valid mirrors: %sN(Rt_replace_and_check_urltbaseurlt
_orig_baseurlt
mirrorurlsR-RR|textendtlistt
metalink_dataRRiRt_getMirrorListRvRR3R^R_ReR.RIRJRLRRRR(RRR2((RR*Zs.


&
cCstpdSnti}|io|ititi	BdnG|i
t|itidt
|dod}||_n|io|it|in|io|i|i|in|S(Niitpost_connection_checkcGstS(N(Ri(targs((Rtcheckers(tm2cryptoLoadedR8tSSLtContexttsslCtxRRt
set_verifytverify_peertverify_fail_if_no_peer_certtset_allow_unknown_caRitverify_noneR3R9R7Rtload_verify_locationsRRt	load_certR(RR9R=((RR
~s 

	


cCsg}
d}x|D]}ti||i}|ddjo|d}nt	i	|\}}	}}}}|ddddgjo
|}qq|
i|qW|dj	o3|
odti|GHqdti|GHn|
S(	NiRXRRRRsMYumRepo Warning: Some mirror URLs are not using ftp, http[s] or file.
 Eg. %ssJYumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. %s(tgoodurlsR8tskippedturl_listRtparsert
varReplaceRR}RtstbtptqtftoR!RJtto_utf8(RRGRFRNRRORMRLRJRKRE((RR/s"!
cCs|ip|in|iS(N(RRvR*(R((Rt_geturlss
tfgetcCs
|iS(N(RRQ(R((RRstfsetcCst|d|S(NRv(R%Rtvalue(RRT((RRstfdelcCst|ddS(NRv(R%RR8(R((RRscCs|ip|idd|_|id}|ipti|i}|i
}y8td|i
|}|i||d|id}Wqtiij
oQ}tii|ipd|}ti|nd||fGHt|_qXn|ipmy)ti||_ti ||iWqoti!j
o.}d	||fGHt|_ti"|qoXn|ioti|i|_qn|iS(
NRXsmetalink.xmls.tmpRttexts	/metalinksQCannot retrieve metalink for repository: %s. Please verify its path and try agains'Could not get metalink %s error was 
%ss)Could not parse metalink %s error was 
%s(#RRR6tmetalink_filenametlocalt_metalinkCurrentRJRPRRRRRRtugturlgrabRRcRtgrabberRjRR^R_ReRR#R$RiRtMetaLinkRepoMDtshutiltmovetMetaLinkRepoErrorParseFailRL(RRRRcRRRZRX((Rt_getMetalinks4


#

	
cCs
|iS(N(RRa(R((RRscCst|d|S(NR(R%RRT(RRT((RRs	cCst|ddS(NR(R%RR8(R((RRsRcCsg|djo
|i}n|djp
|djotid|in|idjo5t	i
i|o|Sqtid||fn|o"t
i|\}}}}
}n|io|iod}|o(|djo|ot|}qny\|id|d|d|d|d	|d
|d|id|id
|d||f
}|SWqtij
o#}ti t!i"d|fqXn|o|djo|i#d|
}t%d|i&d	|d|	d|i(d|i)d||}|d|}y:|i,t-i.||dt-i.|d||f}Wqct/j
oK}d||i|f}|i1djoti2|qti|qcXnt3|i4d|
}yU|i6i,t-i.||dt-i.|d||fd	|d|	d|d|}WnWt/j
oK}d||i|f}|i1djoti2|qcti|nX|S(sretrieve file from the mirrorgroup for the repo
           relative to local, optionally get range from
           start to end, also optionally retrieve from a specific baseurls/get request for Repo %s, gave no source or destis0Caching enabled but no local cache of %s from %sRRXt	checkfunctrelativeRVRRRRtdiscnumtranges8Error getting package from media; falling back to url %sRIRRRRRXs*failed to retrieve %s from %s
error was %siRsfailure: %s from %s: %sN(7RR8RRXRcR#R$RRIR^R_ReRRRtschemetnetloctquerytfragidRRRdtintRbRVRtstarttendRct
MediaErrorRtverbose_loggertlogt
logginglevelstDEBUG_2RRRRRRRRZR]R[RJRPRjterrstrRtNoMoreMirrorsRepoErrorRR	Rtgrab(RRRcRXRkRlRRbRVRRIRRrRhRdRfR]RgRiR_RRRZRc((Rt_getFilesl	

"T#		c
Cs|i}|i}|i}|i|o&|io|Snt	i
|n|id|d|d|d|d|d|S(NRRcRXRbRVRI(tpackagetrelativepathR]tlocalPkgRXtbasepathRt_preload_pkg_from_system_cachetverifyLocalPkgRJRLRuRbRVRI(RRvRbRVRIR]RXRy((Rt
getPackage7s		
c
Cs|i}|i}|i}|i}|i	}	t
ii|ipt
i|in|id|	d|d|d|ddd|d|dd	d
|	S(NRRcRXRkRRlRbRiRI(RvRwR]tlocalHdrRXthdrstartRkthdrendRlRyR^R_ReRRRRuR8RbRI(
RRvRbRRIR]RkRlRXRy((Rt	getHeaderIs				cCs|idjo@|idd}|io!tii|o
t	|_qPn|idjo5|idd}tii|p
t	|_qn|idjo|i|i|i
|_n|iS(sCheck if there is a metadata_cookie and check its age. If the
        age of the cookie is less than metadata_expire time then return true
        else return False. This result is cached, so that metalink/repomd.xml
        are synchronized.RXsmetalink.xmls
repomd.xmlN(RRR8R6tmlfnRR^R_ReRtrepomdfntwithinCacheAgeRtmetadata_expire(RRR((RtmetadataCurrentZscCs|idj	o|iSn|io+tii|ioti	d|n|io
t
|_nStii|ip
t|_n0|i|i
|io
t
|_n
t|_|iS(Ns$Cannot find metalink.xml file for %s(RRR8RIR^R_ReRWR#R$RiRRRR(R((RRYps!



	cCs|djotii|otSnt}tii|o}ti|}|d|t
i
jo
t}n"|dt
i
jo
t}n|dt|i
jo
t}qn|S(sxcheck if any file is older than a certain amount of time. Used for
           the cachecookie and the mirrorlist
           return True if w/i the expiration time limit
           false if the time limit has expired

           Additionally compare the file to age of the newest .repo or yum.conf
           file. If any of them are newer then invalidate the cache
           iiN(texpiration_timeR^R_RetmyfileRiRR&tstattcookie_infottimeRjRR(RRRR&R((RRs 

cCsi|i}tii|ip
|i}nti|tio#t	|id}|i~ndS(s/if possible, set touch the metadata_cookie filesw+N(RRRR^R_ReR6taccesstW_OKtopentfoR(RRR((RtsetMetadataCookies	

cCsy(||_||_||_||_Wntij
o}nX|io@|io6|i	o+|i
o tit
idt|_ndS(Ns1Disabling media repo for non-media-aware frontend(RIRRRRR#R$RRRR0RnRoRpRqRR(RRIRRRR((Rtsetups			
+cCsU|io(tii|otid|n|ip
|iot	Snt
S(s( Should we cache the current repomd.xml s"Cannot find repomd.xml file for %sN(RRIR^R_ReRXR#R$RRiR(RRX((Rt_cachingRepoXMLscCs|ifhf}|djod|ij}nd}yptidddddt	i
i|}|i
d|id	|d
dd|d
dd|d|idj}Wntj
o;}ti||odSntid||fn?titifj
o&ti||odSnnXyt	i||Wn9ti||odSntid||fnX|S(s* Call _getFile() for the repomd.xml file. told_repo_XMLR0tprefixtrepomdtsuffixstmp.xmlR RcRXRiRVRRbRIR'sError downloading file %s: %ssError renaming file %s to %sN(Rt
_checkRepoXMLRbt
grab_can_failR8R{ttfnamettempfiletmktempR^R_tdirnameRXRuRyRVthttp_cachingRcRjRRJRLR#R$Rstrename(RRXRVRRRbRRc((Rt_getFileRepoXMLsB



cCs{yti|i|SWn]tij
oN}|djod|i
j}n|odSntid||fnXdS(s Parse the repomd.xml file. Rs&Error importing repomd.xml from %s: %sN(trepoMDObjecttRepoMDRRRXR#tRepoMDErrorRtparse_can_failR8R{R$(RRXRR((Rt
_parseRepoXMLs
cCsx+ti|idD]}ti|qWtii|oa|d}ti|||i
|t}hd|<d|<d|<dg<|_|SndS(s= If we have an older repomd.xml file available, save it out. s
/*.old.tmps.old.tmpRRXt	old_localtnew_MD_filesN(tglobRR6RaRJRLR^R_ReRXRR^tcopy2RRiROR{R8(RRXRORRa((Rt_saveOldRepoXMLs
-cCs|iptidnd|ijoh|_dSnx"|idD]}ti|qIW|i}h|_d|jot	i
|d|dn|d|_d|jodSnx&|dD]}t	i
|d|qWdS(	s0 If we have older data available, revert to it. s#Can't download or revert repomd.xmlRNRRRXtold_MD_filess.old.tmp(
RRR#R$R{RaRJRLtold_dataR^RRztrevert(RRRRa((Rt_revertOldRepoXMLs&
			


cCss|i}h|_d|joti|dnd|jodSnx#|dD]}ti|dqTWdS(s  Done with old data, delete it. RRNs.old.tmp(RR{RRJRLR(RRR((Rt_doneOldRepoXML s		

cCs|djo
|i}n|djod|ijo
d}n|dddgjo(|i|dd|o|d7}n|ii|o||i|fSn|dfS(NRpRR/RR,t_dbRP(	RPR8RR1RRDtrepoDataRRQ(RR1RP((Rt_get_mdtype_data-s

 
0cCsM|i\}}|idtii|}|o|idd}n|S(NRXs.bz2R0(R2R[R\R]RR6R^R_R`RXt
compressedRH(RR2RR\RXR]((Rt_get_mdtype_fname;s
cCsd|ijotSn|id}|ioP|i|iijo:tidt	i
|it	i
|iiftSntS(s| We check the timestamps, if any of the timestamps for the
            "new" data is older than what we have ... we revert. RshNot using downloaded repomd.xml because it is older than what we have:
  Current   : %s
  Downloaded: %sN(RR{RiRRt	timestampRPRRRtctimeR(RR((Rt_groupCheckDataMDNewerCs
 2cCs|i|ijotSn|i|ijotSnt}xX|iD]M}||i
joqIn|i||i
|jotSn|i|qIWx#dD]}||jotSqqWtS(s7 Check parsed repomd.xml against metalink.repomd data. tsha512tsha256tsha1tmd5N(RRRR(
RPRRRtlengthtsizetsettdonet	checksumsRStchksumstaddRi(RPRRSR((Rt_checkRepoXMLMetalinkUs$	

cCs|djo
|i}n|djo
|i}n|i||iotSnxg|iiD]Y}|i||o@t	i
tidt
i|iit
i|iftSq_q_WtS(s@ Check the repomd.xml against the metalink data, if we have it. s/Using older repomd.xml
  Latest: %s
  Using: %sN(RPR8RRzR5RRRitold_repomdsRnRoRpRqRRRR(RRPR5R((Rt_checkRepoMetalinkps




,cCs{|i|}|ptSn|i|iptSn|ii}|i	o|i
|i
jotSn|i||S(sx Save the Old Repo XML, and if it exists check to see if it's the
            latest available given the metalink data. N(
RRRXtoxmlRR-RR5RRRRiR(RRXRR((Rt_latestRepoXMLs

cCs!|id}|idj	otSn|i|ot}|}nnt}|i
|o|i|itSn|i
||}|djo|itSn|i|i||_|idjo|itSn||_|otSn|ip|itSntS(s` Common LoadRepoXML for instant and group, returns False if you
            should just return. s/repomd.xmlN(RR6RXRzR8RRRitcachingRcRRRRRVRRgR(RRVtmdtypesRRXRc((Rt_commonLoadRepoXMLs8







	

cCsT|djo
|i}n|ii|o#t|i|ijotSqPnt	S(N(
RPR8RRRR1t	DBVERSIONt	dbversionRiR(RR1RP((RRDs

c	Cs|djodSn|p%|id}|i||}nHt	}|i|t	}t
ii|p|i
dd}t}n|it
ii||i||d|d|dtpdSn|S(s Check that we already have this data, and that it's valid. Given
            the DB mdtype and the main mdtype (no _db suffix). Rs.bz2R0RYR2tcheck_can_failN(R2R8t
file_checktdbmdtypetendswithRRRRXRR^R_ReRHRiRdR`t_checkMD(RR2RtmmdtypeRRXR((Rt_groupCheckDataMDValids 

cCsOd}	|ii}|djo
|}ng}d|ijo
d}n|id}||id<g|id<x|D]}|i|\}
}
|o|i|d|\}}|i|||t}|o|	|||
|
oq}nti||d|i||d}tii|o%ti||d|i|q]qan|
djoq}n||joq}n|i|
|
|oq}n|i|
dtp|itSn|i|
t}|
id	o9|}|id
d}t i!||t i"|n|idi|q}W|i#tS(
s Retrieve any listed mdtypes, and revert if there was a failure.
            Also put any of the non-valid mdtype files from the old_repo_XML
            into the delete list, this means metadata can change filename
            without us leaking it. cCs|djotSn||jotSn|i|ijotSntii	|i
d}tii	|i
d}||jotSnt
S(s9 Check if two returns from _get_mdtype_data() are equal. iN(tndataR8RtomdtypetnmdtypetodataRSR^R_R`R[tornametnrnameRi(RRRRRR((Rt
_mdtype_eqs


RRRRPs.old.tmps.sqlitetretrieve_can_failRs.bz2R0N($RRRtkeystall_mdtypesRR8trevertsR{RR1RRRRRRRiRXR^RR!t	gen_localR_ReRGRRRRtdl_localRHRJRKRLR(RRRRRRRR1RRRRXRR((Rt_commonRetrieveDataMDsZ	





	





cCs%|i|o|igndS(s Retrieve the new repomd.xml from the repository, then check it
            and parse it. If it fails revert.
            Mostly traditional behaviour. N(RRRVR(RRV((Rt_instantLoadRepoXMLFscCs%|i|o|i|ndS(s Retrieve the new repomd.xml from the repository, then check it
            and parse it. If it fails we revert to the old version and pretend
            that is fine. If the new repomd.xml requires new version of files
            that we have, like updateinfo.xml, we download those too and if any
            of those fail, we again revert everything and pretend old data is
            good. N(RRRVRR(RRVR((Rt_groupLoadRepoXMLMscCsy|idgjo|i|Sn|idgjo|i|Sn|idgjo |i|ddddgSn|idgjo|i|ddgSn|id	gjo|i|dgSnWn tj
o|inXtid
|idS(s5retrieve/check/read in repomd.xml from the repositorytinstants	group:alls
group:mainR,RpRRqsgroup:smalls
group:primarysBad loadRepoXML policy: %sN(	RtmdpolicyRRVRtKeyboardInterruptRR#R$(RRV((Rt_loadRepoXMLXs  
cCsa|io|iSny|id|Wn.tij
o}d|}ti|nX|iS(NRVsiCannot retrieve repository metadata (repomd.xml) for repository: %s. Please verify its path and try again(RRzRR#R$RR(RRR((Rt_getRepoXMLks

cCs
|iS(N(RR(R((RRwscCst|d|S(NRz(R%RR&(RR&((RRxscCst|ddS(NRz(R%RR8(R((RRyscCst|tijo
|i}n|}|io\ti	djotdd|n|id}yJ|iddddd|d	d
|iddddd
|idj}Wn.tj
o"}tdd||fnXti|||i}|ok|ioay|i||iWn+tij
o}tdd|nXti|||i}n|ptdd|qnyti|i|}Wn1tij
o"}tdd||fnX|i|io(|i |otdd|ndS(Nis?pygpgme is not working so repomd.xml can not be verified for %ss/repomd.xml.ascRcsrepodata/repomd.xml.ascRiRXRVs%s/signatureRRbRIR's1Error finding signature for repomd.xml for %s: %ss;Gpg Keys not imported, cannot verify repomd.xml for repo %ss1repomd.xml signature could not be verified for %ss%Error importing repomd.xml for %s: %ss)repomd.xml does not match metalink for %s(!ttypeRttypestInstanceTypetfilenametfilepathRRRJtgpgmeR8RjR6tsigfileRuRRRcRtvalid_detached_sigR)tvalidRRR#tYumBaseErrorRRRPRR-RR(RRRcRRRRPR((RR{sB




cCs|i|||S(s,check the metadata type against its checksumN(RRtfnR1RY(RRR1RY((RRhscCs|}|djo|ii|}n|o|i\}}n|i
\}}t|t
ijo
|i}	n|}	y|i||	}Wn6tij
o'}
|odSntddnX||jodSn|odSntdddS(s5 Internal function, use .checkMD() from outside yum. isError performing checksumiis%Metadata file does not match checksumN(R2RR8RRPRQR1RYtr_ctypetr_csumRSRRRRRRRtl_csumR#R$RRRj(RRR1RYR2RRRRRRR((RRs*


cCs
|i|S(sbase function to retrieve metadata files from the remote url
           returns the path to the local metadata file of a 'mdtype'
           mdtype can be 'primary', 'filelists', 'other' or 'group'.N(RRGR1(RR1((Rt
retrieveMDscCs@|ii|}|i\}}	ti	i
|	}|id|}|ii|o|i|o|Sqqn|idjoqti	i|oDy|i||Wn%tj
o}
tid|qX|Sqtid||fnti	i|p|iti	i
|o2|i||dtod|i|<|SqSnyk|i|fhf}d|i|f}|id|	d|d	dd
|ddd|d
|idj}Wnjti tifj
o|odSnnLtj
o.}
|odSntid||fnXd|i|<|SdS(s8 Internal function, use .retrieveMD() from outside yum. RXis;Caching enabled and local cache: %s does not match checksums0Caching enabled but no local cache of %s from %sRs%s/%sRcRXRRbRRVRIR's6Could not retrieve %s matching remote checksum from %sN("RRPRQR1RR[R\R]R^R_R`RaR6RXRRRIReRhRjRR#R$RdRRiRbRRVRuR8RRsR(RR1RR\RXRRbRaRVR]R((RRGsH/

cCs
|idS(s]this gets you the path to the primary.xml file, retrieving it if we
           need a new oneR,N(RR(R((RR<
scCs
|idS(s_this gets you the path to the filelists.xml file, retrieving it if we
           need a new oneRN(RR(R((RR@scCs
|idS(NR/(RR(R((RRBscCs@d|iijo|iddtSn|iddtS(sggets groups and returns group file path for the repository, if there
           is none it returns NoneRRRpN(RRPRRGRi(R((Rt	getGroupsscCs||_t|_dS(N(RRRiR(RR((RtsetCallback!s	cCs||_t|_dS(N(RRRiR(RR((Rt
setFailureObj%s	cCs||_t|_dS(N(RRRRiR(RR((RtsetMirrorFailureObj)s	cCs||_t|_dS(N(RRRRiR(RR((RtsetInterruptCallback-s	c	Csg}g}|d	j	oy|i}WnAtj
o5}|d	jo
d}nd||fGHg}nXx||D]p}t	i
d|pt	i
d|oqtnt	idd|}t	i
dd|\}}|i|qtWn||fS(
s5 read the mirror list from the specified file object s	<unknown>s+Could not read mirrorlist %s, error was 
%ss^\s*\#.*s^\s*$s
$R0s\$ARCHs	$BASEARCHN(t
returnlisttcontentRR8t	readlinest	ExceptionRRtlinetretmatchtsubRtsubntcountR!(	RRRRRRRRR((Rt_readMirrorList1s&


&cCs|idd|_d	}
t}|i|i|io)t	}t
|id}
d|i}n|i}t
i
|d}|djod|}n|i}ytii||}
Wn0tiij
o}d||fGHd	}
nX|i|
|\}	}|	oU|ioF|o>t
|id}x|D]}|i|q<W|iqnS|oJtii |io4ti!|id	|it
|iddSn|	S(
s$retrieve an up2date-style mirrorlist file from our mirrorlist url,
           also save the file to the local repo dir and use that if cache expiry
           not expired

           we also s/$ARCH/$BASEARCH/ and move along
           return the baseurls from the mirrorlist file
           RXsmirrorlist.txttrsfile://iR0s-Could not retrieve mirrorlist %s error was
%stwN("RR6R.R8RRtcacheokRtmirrorlist_expireRiRRRRRfRRRR\turlopenRjRRRRRIRRtwriteRR^R_Retutime(RRRRRRRRRfRR((RR6Gs<	
!cCs{tii|ptSntii|o9ti|titi|tijotSqgnti	||t
S(s&attempts to copy the file, if possibleN(R^R_ReRRtdestfnRtST_CTIMER^RRi(RRR
((Rt
_preload_filers-R0cCst|dptSn|idjotSntii|i|i}tii	|ptSntii
|tii
|ijotSn|d|tii
|}|djo%|id|tii
|}n|i||S(sLattempts to copy the file from the system-wide cache,
           if possibletold_base_cache_dirR0RXN(R3RRRR^R_RRtglob_repo_cache_dirRetnormpathR6tsubdirR`RRR
R8R(RRRR
RR((Rt_preload_file_from_system_cache}s(
%cCs
|i|S(sUattempts to copy the metadata file from the system-wide cache,
           if possibleN(RRR(RR((RRdscCstii|i}tii|i|}|i
|iddd|otSnt|dpt
Snx;|iD]0}|itii|||otSq|q|Wt
S(sOattempts to copy the package from the system-wide cache,
           if possibleRs	packages/R
R$N(R^R_R`tpkgRxtpnameRRRR
RRiR3RR$topkgdirR(RRR
RR((RRzs

"(eRkRlRmRRRtpropertyRRRt_YumRepository__getProxyDictRRRRRRRRRRRRRiR	RRRR
RtgrabfuncRtRR!R#R'R6RRR)RR+R-R*R
R/RQRRaR5R8Rut_YumRepository__getR|RRRYRRRRRRRRRRRRtstaticmethodRRRRRDRRRRRRRPRRhRRRGR<R@RBRRRRRRR6RRRdRz(((RRns	;	
	
														
												$					$	'Z					)			
		(
Y			-#	5									+		c
Csjtidtiddg}ttido
ti}ndk	}|}t
i
|d}
|
djod|}n|}y|i|d|}Wn0tiij
o}d	||fGHd}nX|dj	o|i}x||D]p}	tid
|	ptid|	oqntidd|	}tid
d|\}}|i|qWn|S(Ns9getMirrorList() will go away in a future version of Yum.
RiR
iR0sfile://Rs-Could not retrieve mirrorlist %s error was
%ss^\s*\#.*s^\s*$s
$s\$ARCHs	$BASEARCH(RRR#RRR3RR\turlresolverturllibRRRfRR
tpdictRRjRR8RRRRRRRRRR!(
RRRRRRRRRRRfRR((Rt
getMirrorLists6	
	

&(4R^RRRRt
uses_fragmentR!R#turlgrabber.grabberRRturlgrabber.mirrorRRjRRtreposRtRHR4RtyumRrRJt	constantsRtM2CryptoR;RiR:tImportErrorRtloggingRpRRR^RRRRftsimplefilterRt	getLoggerRRnRRRsRnR8R (#RR#RfRHRJR^R RtRRRpRRRjRR:RrRRRRRnR)RRRRRRR;RR4RnR^R((RRsZ						

	
		
			

	

								


Anon7 - 2021