[c!@s!ddkZddkZddkZddkZddkZeiidddkZddkZddk l Z ddk l Z ddk Z ddk lZddkZddkZddklZddkZddkZddkZddklZddklZdd klZdd kTddkZddkZddkZddkZddkZddk Z ddk!Z!ddk"Z"ddk#Z#e$Z%ei&d ei'ei(d Z)ei(d Z*dei+fdYZ,deei-fdYZ.e/dZ0dfdYZ1dS(iNtmedia(t URLGrabber(tdefault_grabber(t URLGrabError(t Repository(tconfig(tmisc(tcomps(t*tignores yum.Repossyum.verbose.RepostYumPackageSackcBsYeZdZdZdZdZd dZdd ddZdZ d Z RS( s;imports/handles package objects from an mdcache dict objectcCs&tii|||_h|_dS(N(t packageSackt PackageSackt__init__tpctadded(tselft packageClass((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR Fs cCs|idS(N(tclose(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt__del__KscCs h|_dS(N(R(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRNsc Cs||ijo||i|jodSnt|}|djod}x~|D]v}|d7}|o|i|||n||}|i||} || _|i|i|| |i| qSW||ijog|i|Z9d?Z:d@Z;dududududAZ<dBZ=dududCZ>dudDZ?dEZ@dFZAdGZBdudHZCedIZDdJZEeFdKZGdududLZHdMZIdudNZJdudOZKedPZLdudQZMdududRZNdSZOdudTZPdUZQed/dVd1dWd3dXZRdYZSdZZTed[ZUedued\ZVd]ZWed^ZXd_ZYd`ZZdaZ[dbZ\dcZ]ddZ^deZ_dfZ`dudgZadhZbdiZcdjdudkZddlZedmZfdnZgdoZhdpZidqdrgdsZjRS(vso This is an actual repository object Configuration attributes are pulled in from config.RepoConf. cCstii|ti||d|_g|_g|_d|_d|_ d|_ d|_ d|_ h|_ d|_d|_h|_h|_d|_d|_d|_t|_h|_d|_d|_d|_d|_d|_hdd6dd6dd 6dd 6dd 6dd 6|_t|_d|_d|_ d|_!d|_"t|_#d|_$d|_%d|_&d|_'t(|_)d|_*d|_+d|_,dS( Nis yumgroups.xmlsrepodata/repomd.xmlt cachecookietiR1RR4tgroupt updateinfot prestodelta(-RtRepoConfR RR9trepofilet mirrorurlst_urlst enablegroupstgroupsfilenamet repoMDFilet_repoXMLRft_oldRepoMDDataRCtmirrorlistparsedtyumvart _proxy_dicttmetadata_cookie_fnt_metadataCurrentt _metalinktFalset groups_addedt http_headerstrepo_config_aget basecachedirtbase_persistdirtcostt copy_localt retrievedt_preloaded_repomdR%t failure_objtmirror_failure_objtinterrupt_callbackt_callbacks_changedt mediafunctgpg_import_functgpgca_import_funct confirm_funcRGttimestamp_checkt_sackt _grabfunct_grab(RR/((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR sR                                    cCsf|djodSt|do |i}nd}t|i|}|o|St|i|iS(s@ Sort yum repos. by cost, and then by alphanumeric on their id. iRiN(R9R5RtcmpR(RR4tocosttret((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt__cmp__#s  cCs0|idjotiti|_n|iS(N(RR9t sqlitesacktYumSqlitePackageSacktYumAvailablePackageSqlite(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_getSack0scCs2|idj o|iinti|dS(N(RR9tsackRR(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR<scCs d|_dS(N(R9R(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _resetSackAscCs |i|io|iSdS(N(t doProxyDictRR9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt__getProxyDictDs  cCs|iS(s7Returns the instance of this repository's package sack.(R(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytgetPackageSackNscCs"t|do|idj StS(s;Returns true if this repository is setup and ready for use.tmetadata_cookieN(R5RIR9R(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytreadySscCsEd|iijo|iid}n|iid}|iS(s"Returns the location of the group.tgroup_gzRt(RIt fileTypesRJR_(Rtthisdata((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytgetGroupLocationZscCs|iS(N(R(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt__str__bsiicCs[yti||||SWn:titfj o%}|odStid|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(RRKRt MiscErrortEnvironmentErrorR9R (RtsumtypetfiletCHUNKtchecksum_can_failtdatasizete((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _checksumes c Csd|i}d'}xt|D]}|id"oq n||joq ntt||tioq nt||}| o/t|tttd#fjo d$}nt|ti jod%i |}n|d&||f}q W|S((Ns[%s] RRt metalink_datatgrabtgrabfuncRItcfgRRRRRR%RRRRRRR|RRRRRtquick_enable_disableR}RturlsRyRRxt_iRss, s%s = %s ( s mediafuncssacks metalink_datasgrabsgrabfuncsrepoXMLRs retrievedsmirrorlistparsedsgpg_import_funcsgpgca_import_funcs failure_objscallbacks confirm_funcs groups_addedsinterrupt_callbacksidsmirror_failure_objsrepo_config_agesgroupsfilenames copy_locals basecachedirs http_headerssmetadata_cookiesmetadata_cookie_fnRs repoMDFilestimestamp_checksurlss mirrorurlssyumvarsrepofile( Rtdirt startswitht isinstancetgetattrttypest MethodTypettypeRtListTypetjoin(Rtoutputt excluded_varstattrtres((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytdumprs6   - cCss|iyti|ddgWnHtj o<}|itijoti|qott|nXdS(s%Persistently enables this repository.tonlytenabledN( tenableRtwriteRawRepoFiletIOErrorterrnotEACCEStloggertwarningtstr(RR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytenablePersistents cCss|iyti|ddgWnHtj o<}|itijoti|qott|nXdS(s&Persistently disables this repository.RRN( tdisableRRRRRRRR(RR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytdisablePersistents 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(RRztmediaidRR R(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytchecks!cCs|iodSh|_d}d }|i|jo d}n|iod|i}|i|jouti|i}|i|jo|dti|i7}ntid|i \}}d|||f}qn|dj o+||id<||id<||id scCs |iS((R(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR  scCstii|otii|odS|iotid|nyti|ddWn7tj 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`RaRdtisdirRCRR tmakedirstOSError(RtdpathRtmsg((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_dirSetupMkdir_p s& c Cstii|i|i}tii|i|i}tii|d}tii|d}|id||id||id||id|d}tidjo d }n|id |d ||id |d ||id|i }|id|x'|i|i gD]}|i |q*Wx@|i gD]2}y|i |WqNt ij o }qNXqNW|ido t|_n|id|id|iddS(s6make the necessary dirs, if possible, raise on failuretpackagesRt_dir_setup_cachedirt_dir_setup_pkgdirt_dir_setup_hdrdirt_dir_setup_persistdirRsis-rot_dir_setup_gpgdirs/gpgdirt_dir_setup_gpgcadirs /gpgcadirR\t_dir_setup_metadata_cookies repomd.xmlRrsmirrorlist.txts metalink.xmlN(R`RaRRRRt setAttributetgeteuidR8RtpkgdirR't persistdirRR RcRGR( RR8R3R2thdrdirtexttcookieRR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytdirSetups:      cCs5d|}t||p|int||S(s; Make the directory attributes call .dirSetup() if needed. t _dir_setup_(R5R7R(RR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _dirGetAttrCs cCsd|}t||p|in|djo:t|dp g|_n|iit||nt|||}|djo|i|n|S(s; Make the directory attributes call .dirSetup() if needed. R8R*t _old_pkgdirs(s_dir_setup_pkgdir(R5R7R:RRtsetattrR'(RRtvalR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _dirSetAttrIs    cCs |idS(R8(R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR XscCs |idS(R3(R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR YscCs |idS(R2(R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR [scCs|id|S(R2(R=(Rtx((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR \scCs |idS(R4(R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR ]scCs|id|S(R4(R=(RR>((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR ^scCs |idS(tgpgdir(R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR _scCs|id|S(R?(R=(RR>((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR `scCs |idS(tgpgcadir(R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR ascCs|id|S(R@(R=(RR>((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR bscCs |idS(R(R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR cscCs'tidtidd|idS(Ns8baseurlSetup() will go away in a future version of Yum. Ri(RRRRt _baseurlSetup(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt baseurlSetupes cCsL|iodS|ipdS|iiddjodS|i|_dS(Ntmetalinki(RCt mirrorlisttfind(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_hack_mirrorlist_for_anacondajs  cCs|i|i|_|i|_g}|i|io4|i o)|it|ii t |_n|i o+|i o |i|i t |_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(t_replace_and_check_urltbaseurlt _orig_baseurlRFRCRtextendtlistRRRGRDt_getMirrorListRyRzRR5R`RaRdRGRCRRERR$R(RRyR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRAys,    &  c Csg}d}x|D]}|d joqnti||i}|ddjo|d}ny%ti|\}}}}} } Wn$tttfj o} d}nX|d jo |}qq|i|qW|dj o3|od t i |GHqd t i |GHn|S( NRsiR\tblahRRRRsMYumRepo 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(RsN(shttpsftpsfileshttps( R9tparsert varReplaceRturlparset ValueErrort IndexErrortKeyErrorRRtto_utf8( Rturl_listtgoodurlstskippedturltstbtptqtftoR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRHs, %   cCs|ip|in|iS(N(RzRA(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_geturlss tfgetcCs |iS((R`(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR stfsetcCst|d|S(Rz(R;(Rtvalue((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR stfdelcCst|ddS(RzN(R;R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR sc Cs|ip|idd|_|id}|ipti|i}|i}y8td|i |}|i ||d|i d}Wqt i ij ok}tii|ipd|}ti|nd||id ti|id fGHt|_qXn|ipmy)ti||_ti||iWqtij o.}d ||fGHt|_ti|qXn|ioti|i|_qn|iS( NR\s metalink.xmls.tmpRttexts /metalinksQCannot retrieve metalink for repository: %s. Please verify its path and try agains*Could not get metalink %s error was %s: %siis)Could not parse metalink %s error was %s(RR8tmetalink_filenamet_metalinkCurrentRRURCRRR%turlgrabRRtgrabberRR`RaRdRR targst to_unicodeRGRtMetaLinkRepoMDtshutiltmovetMetaLinkRepoErrorParseFailRE(RtlocalRYRtugRmRR&((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _getMetalinks6    #)   cCs |iS((Rr(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR scCst|d|S(R(R;(RRc((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR s cCst|ddS(RN(R;R9(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR sRc Cs|djo |i}n|djp |djotid|in|idjo2tii|o|Stid||fn|o"t i |\} } }}}n|i o|i od}|o(| djo|ot |}qny\|i d|d|d|d|d |d |d |i d |id |d||f }|SWqtij o#}titid|fqXn|o6| djo)|id| }td|id |d| d|id|id|d| |}|d|}y:|iti||dti|d||f}Wqtj o}}|i|| d||i|f}|io|d7}|d7}n|idjoti |qti|qXnt!|i"d| }y[|i#iti||dti|d||fd |d| d|d|d| }Wngtj o[}|i|| d||i|f}|idjoti |qti|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 %sRRpt checkfunctrelativeReRRYRtnametdiscnumtranges8Error getting package from media; falling back to url %sRCRRRRtsizeR\s*failed to retrieve %s from %s error was %ss0 You could try running: yum clean expire-caches To get a new set of mirrors.iRsfailure: %s from %s: %sN($R9RRR RRCR`RaRdRQturlsplitRRtintRut MediaErrortverbose_loggertlogt logginglevelstDEBUG_2RRR%RRRhRRURt _del_dl_fileRyRtNoMoreMirrorsRepoErrorRRR(RRYRtRptstarttendRRsReRRCRxtschemetnetlocRatquerytfragidRvRmRRRqRjterrstrR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_getFiles  "T#       cCs|i}|i}|i}|i|o#|io|Sti|n|id|d|d|d|d|d|d|iS(NRYRtRpRsReRCRx( t relativepathtlocalPkgtbasepatht_preload_pkg_from_system_cachetverifyLocalPkgRRERRx(RtpackageRsReRCRjRpR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt getPackageQs    c Cs|i}|i}|i}|i}||} |i} tii|ipti |in|i d| d|d|d|ddd|d|dd d |d | S( NRYRtRpRRRRsRiRCRx( RtlocalHdrthdrstartthdrendRR`RaRdR4R#RR9( RRRsRRCRjRpRRRxR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt getHeaderds      !cCs|idj o|iS|i|i|i}|p||_|S|idd}tii|pt |_t S|i |idd}|i o"tii| ot |_t St |_t S(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.R\s repomd.xmls metalink.xmlN( RR9twithinCacheAgeRtmetadata_expireR8R`RaRdRRFRCRG(RtmC_deftrepomdfntmlfn((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytmetadataCurrentvs"     cCs|idj o|iS|io+tii|i otid|n|io t |_nStii|ip t |_n0|i |i |i o t |_n t |_|iS(Ns$Cannot find metalink.xml file for %s(RR9RCR`RaRdRfRR RGRRRR(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRgs!     cCs|djotii|otSt}tii|o}ti|}|d|tijo t}n"|dtijo t}n|dt|ijo 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 ii( R`RaRdRGRtstatttimeRzR(Rtmyfiletexpiration_timeR<t cookie_info((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRs   cCsi|i}tii|ip |i}nti|tio#t|id}|i~ndS(s/if possible, set touch the metadata_cookie filesw+N( RR`RaRdR8taccesstW_OKtopenR(RRtfo((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytsetMetadataCookies   cCsy1||_||_||_||_||_Wntij o }nX|i oI|io?|i o4|i o)t i t i dt|_t|_ndS(Ns1Disabling media repo for non-media-aware frontend(RCRRRRRR RRDRIR|R}R~RRRRGtskip_if_unavailable(RRCRRRRR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytsetups     + cCsR|io(tii| otid|n|ip |iotStS(s( Should we cache the current repomd.xml s"Cannot find repomd.xml file for %s( RCR`RaRdRR RRGR(RRp((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_cachingRepoXMLs cCs|idhf}|djod|ij}nd}yvtidddddtii|}|id|i d |d d d |d dd|d|i djdd}Wn~t j o8}t i ||odStid||fn<titifj o#t i ||odSnXyti||Wn6t i ||odStid||fnX|S(s* Call _getFile() for the repomd.xml file. t old_repo_XMLRstprefixtrepomdtsuffixstmp.xmlRRtRpRiReRRsRCR,RxisError downloading file %s: %ssError renaming file %s to %s(N(t _checkRepoXMLR9RttempfiletmktempR`RatdirnameRR}t http_cachingRRRERR Rtrename(RRpRet grab_can_failRsttfnameRmR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_getFileRepoXMLsD      cCsxyti|i|SWnZtij oK}|djod|ij}n|odStid||fnXdS(s Parse the repomd.xml file. Rs&Error importing repomd.xml from %s: %sN(t repoMDObjecttRepoMDRRt RepoMDErrorR9RR (RRptparse_can_failR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _parseRepoXMLs cCsx+ti|idD]}ti|qWtii|oh|d}ti|||i |t }|djodSh|d6|d6|d6gd6|_ |SdS(s= If we have an older repomd.xml file available, save it out. s /*.old.tmps.old.tmpRRpt old_localt new_MD_filesN( tglobR8RRER`RaRdRmtcopy2RRGR9R(RRpRkRRW((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_saveOldRepoXMLs  cCs|iptidnd|ijoh|_dSx"|idD]}ti|qFW|i}h|_d|joti|d|dn|d|_d|jodSx&|dD]}ti|d|qWdS( s0 If we have older data available, revert to it. s#Can't download or revert repomd.xmlRNRRRpt old_MD_filess.old.tmp( RRR RRRER`RR~(RRktold_datatrevert((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_revertOldRepoXML,s$        cCsp|i}h|_d|joti|dnd|jodSx#|dD]}ti|dqQWdS(s Done with old data, delete it. RRNs.old.tmp(RRRE(RRR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_doneOldRepoXMLKs     cCs|djo |i}n|djod|ijo d}n|djo(|i|dd|o|d7}n||ii|fS( NRtRR4RR1t_dbRI(sothers filelistssprimary(R9RIRR@trepoDatatget(RRLRI((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_get_mdtype_dataXs     cCsP|i\}}|idtii|}|oti|dt}n|S(NR\R](R_R8R`RaRbRRDRG(RRNt compressedRiRjRp((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_get_mdtype_fnameds cCs}d|ijotS|id}|ioM|i|iijo7tidti|iti|iift StS(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: %s( RRGRt timestampRIRRRtctimeR(RR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_groupCheckDataMDNewerls   cCs|i|ijotS|i|ijotSt}xN|iD]C}||ijoq@n|i||i|jotSt}q@W|S(s7 Check parsed repomd.xml against metalink.repomd data. (RRtlengthRxt checksumstchksumsRG(RIRtdoneRK((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_checkRepoXMLMetalink~s  cCs|djo |i}n|djo |i}n|i||iotSxd|iiD]V}|i||o=tit i dt i |ii t i |i ftSq\WtS(s@ Check the repomd.xml against the metalink data, if we have it. s/Using older repomd.xml Latest: %s Using: %sN(R9R~RRRRGt old_repomdsR|R}R~RRRRR(RRIRR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_checkRepoMetalinks       cCsr|i|}|ptS|i|iptS|ii}|io|i|ijotS|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. ( RRRFRCRRRRRGR(RRptoxmlR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_latestRepoXMLs   cCs*|id}|idj otS|i|ot}|}not}|i|o |}|i}|d|_n/|i||}|djo|i tS|i |idjo|i ||_n|idjo|i tS||_ |otS|i p|i tStS(s` Common LoadRepoXML for instant and group, returns False if you should just return. s /repomd.xmlRN(R8R~R9RRRGRRRRRRRfR(RRetmdtypesRptcachingRmR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_commonLoadRepoXMLs8          cCsN|djo |i}n||ijo t|i|ijotSntS(N(R9RIRt DBVERSIONt dbversionRGR(RRLRI((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR@s    c Cs|djodS|p%|id}|i||}nKt}|i|t}tii|pti|dt }t }n|i tii ||i ||d|d|dt pdS|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). RR]R^RNtcheck_can_failN( R9tendswithRRR`RaRdRRDRGRcRbt_checkMD(RRNtdbmdtypetmmdtypet file_checkRRp((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_groupCheckDataMDValids  c Csd}|ii}|d jo |}ng}d|ijo d }n|id}||idscCs=d|iijo|iddtS|iddtS(sggets groups and returns group file path for the repository, if there is none it returns NoneRRRt(RIRRBRG(R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt getGroupsscCs||_t|_dS(N(R%RGR(RR%((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt setCallbacks cCs||_t|_dS(N(RRGR(RR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt setFailureObjs cCs||_t|_dS(N(RRGR(RR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytsetMirrorFailureObjs cCs||_t|_dS(N(RRGR(RR%((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytsetInterruptCallbacks cCsg}g}|dj oy|i}WnAtj o5}|djo d}nd||fGHg}nXxW|D]K}tid|oqtn|i}|idd}|i|qtWn||fS(s5 read the mirror list from the specified file object s s+Could not read mirrorlist %s, error was %ss\s*(#|$)s$ARCHs $BASEARCHN(R9t readlinest ExceptionRRtrstriptreplaceR(RRRYt returnlisttcontentRtlineR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_readMirrorLists$     c Cs|idd|_d }t}|i|i|io)t}t|id}d|i}n|i}t i |d}|djod|}n|i }yt i i ||}WnJt i ij o8}d||idti|idfGHd }nX|i||\}}|oU|i oF| o>t|id } x|D]} | i| qVW| iqnP| oGtii|io1ti|id |it|iddS|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 R\smirrorlist.txttrsfile://iRss1Could not retrieve mirrorlist %s error was %s: %sitwN(R8RGR9RRtmirrorlist_expireRGRRDRQRRRiturlopenRRjRRkR%RCtwriteRR`RaRdtutime( RRtcacheokRYRRRR"R#RR$((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRMs:   ) cCsutii|ptStii|o6ti|titi|tijotSnti||tS(s&attempts to copy the file, if possible( R`RaRdRRtST_CTIMERmRRG(RRtdestfn((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _preload_files- RscCst|dptS|idjotStii|i|i}tii|ptStii|tii|i jotS|d|tii |}|djo%|i d|tii |}n|i ||S(sLattempts to copy the file from the system-wide cache, if possibletold_base_cache_dirRsR\N( R5RR0R`RaRRRdtnormpathR8RbR9R/(RRtsubdirR.tglob_repo_cache_dirR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_preload_file_from_system_caches( %cCs |i|S(sUattempts to copy the metadata file from the system-wide cache, if possible(R4(RR((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRc scCstii|i}tii|i|}|i|iddd|otSt|dpt Sx8|i D]-}|i tii|||otSqvWt S(sOattempts to copy the package from the system-wide cache, if possibleR2s packages/R.R:( R`RaRbRRR2R4RGR5RR:R/(RtpkgtpnameR.topkgdir((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRs  " c Csg}dGHy|ii}Wn>tij o/}tddt|}|i||SXxr|D]j}d|GHy|i|Wqftij o8}d|}td|t|}|i|qfXqfW|S(Ns verifying mdisfailed to load repomd.xmls verifying %ss.%s metadata missing or does not match checksumi(RIRRR tRepoVerifyProblemRRR(Rtproblemstmd_typesRtprbtmd_typeR&((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _verify_md"s$   cCsdGHg}|i}|dj oti|}nyti}|i|WnLtiti fj o4}d}t t |t |}|i|n;X|i djo)d}t t |d}|i|n|S(Nsverifying compsscomps file failed to addisno groups in compsRs(RR9RRDRtCompstaddRt GroupsErrortCompsExceptionR8tREPO_PROBLEM_COMPSRt compscount(RR9tgrpfiletcRR&R;((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt _verify_comps7s"   cCsgS(N((R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt_verify_packagesSstrepodataRcCsg}d|jo|i|ind|jo%|io|i|iq\nd|jo|i|in|S(s}download/verify the specified items @items = ['repodata', 'comps'] can include: repodata, comps, packages RHRR((RKR=R{RFRG(RtitemsR9((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytverifyVs    iN(kRnRoRpR RRtpropertyRRRt_YumRepository__getProxyDictRRRRRRR9RRRRRRRGRRRRRRRRR'R7R9R=R8R3R2R4R?R@RRBRFRARHR`RRrRRt_YumRepository__getRRRRgRRRRRRRRRRRRt staticmethodRRRRR@RRRRRRRIRRRgRRRBR:R<R>RRRRRR%RMR/R4RcRR=RFRGRJ(((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyRqs ;                   '             $     $   `     *      )  q     , '  _          +       c Csbtidtiddg}ttido ti}nddk}|}ti|d}|djod|}n|}y|i |d |}WnJtii j o8}d ||i dt i |i d fGHd}nX|dj of|i} xW| D]K} tid | oq n| i} | id d} |i| q Wn|S(Ns9getMirrorList() will go away in a future version of Yum. RiR)iiRssfile://R s1Could not retrieve mirrorlist %s error was %s: %sis\s*(#|$)s$ARCHs $BASEARCH(RRRRR5RRiRRQR)RRjRRkR9RRRR R!R( RDtpdictR"t urlresolverRRRYRRR#R$R((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyt getMirrorListgs4    )    R8cBseZdZedZRS(s9 Holder for each "problem" we find with a repo.verify(). cCs(||_||_||_||_dS(N(Rtmessagetdetailstfake(RRR&RSRT((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR s   (RnRoRpRR (((s//usr/lib/python2.6/site-packages/yum/yumRepo.pyR8s(2R`RRRRQt uses_fragmentRRRturlgrabber.grabberRRturlgrabber.mirrorRRRR treposRROR6RtyumRRRt constantsRCtloggingR~RRRmRRRRGRet simplefilterRt getLoggerRR|R R RwRqR9RQR8(((s//usr/lib/python2.6/site-packages/yum/yumRepo.pytsX                        %