v_c@sddlZddlZddlZddlZddlZddlZddlmZddlZ ddl m Z 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 t RepoStoragecBseZdZdZdZddZdZdZdZ dZ dZ d Z d Z eed Zd 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(treposRR tcacheRtpkgSacktloggingt 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 |j t }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|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.pyt setCacheDir.s   cCs.x'|jjD]}|j||qWdS(s6sets the progress bar for downloading files from reposN(RRat setCallback(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(RR R ((s-/usr/lib/python2.7/site-packages/yum/repos.pyRJscCs|jS(N(R(R((s-/usr/lib/python2.7/site-packages/yum/repos.pytgetPackageSackNsRRtmetadataic Cs|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} |d krl|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(!RRZR R)RRattypettypestListTypet isinstancet RepositoryR3Rlt StringTypeR&R'R(RR*Rt_retrieve_asyncR!tpopulatet TypeErrortargst startswithR.R/R0R,R-RtaddSack( RtwhichtmdtypeR t 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 dZ dZ d Z d Zd Zd 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|js       h