;ò ¥ãBc@sódkZdkZdkZdkZdklZlZdklZdk Tdk Tdk Z ha ha hadZdfd„ƒYZd„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zed„Zed„ZdS(N(sis_urls url_download(svarname2dictlist(s*sindexsCachecBs#tZd„Zd„Zd„ZRS(NcCsL||_||_||_||_||_d|_d|_d|_dS(s-An object in the dictionary of cache entries.iN( s indexnamesselfs localnamesrtimesltimesatimesupdatedsgoneswritten(sselfs indexnames localnamesrtimesltimesatime((s*/mnt/gmirror/ports/devel/aap/work/Cache.pys__init__4s       cCs)tiitii|iƒ|iƒSdS(s0Return the name of the cache file with the path.N(sosspathsjoinsdirnamesselfs indexnames localname(sself((s*/mnt/gmirror/ports/devel/aap/work/Cache.pyslocalname_path?scCs |io |iSn|iSdS(sReturn the last modified time.N(sselfsrtimesltime(sself((s*/mnt/gmirror/ports/devel/aap/work/Cache.pys timestampCs  (s__name__s __module__s__init__slocalname_paths timestamp(((s*/mnt/gmirror/ports/devel/aap/work/Cache.pysCache3s cCs‰|o"yt||dƒWq)q)Xny)t|dƒ}|iƒ}|iƒWn dSnXdt |Get the value of the $CACHEPATH variable as a list of strings.s_nos CACHEPATHscCstii|dƒS(Nsname(sosspaths expandusersx(sx((s*/mnt/gmirror/ports/devel/aap/work/Cache.pys=sN(srecdictsmapsvarname2dictlist(srecdict((s*/mnt/gmirror/ports/devel/aap/work/Cache.pys cache_dirlist9s  cCs t|dƒdtiƒ}ti|ƒ ondt|iN(sget_var_val_intsrecdictsossgetcwdscheckscache_val_readshas_keys cache_dirlistsnspathsjoinsabspaths index_fnamesindexs cache_indexess cache_readscache(srecdictsindexsnscheck((s*/mnt/gmirror/ports/devel/aap/work/Cache.pys fill_cacheAs  !cCs:x!tiƒD]}t||ƒq WhahahadS(saUpdate all cached index files. Empties our cache. Called just before $CACHEPATH is changed.N(s cache_indexesskeyssns cache_updatesrecdictscachescache_val_read(srecdictsn((s*/mnt/gmirror/ports/devel/aap/work/Cache.pys dump_cacheQs cCsPti|ƒo8t|}|io|Sn| otd|ddƒ}ntiƒ|i t |ƒjo|Sn|i djo¿dk l }|||ƒ}|djo ||i jo7t|tdƒ|ƒtiƒ|_ d|_|Sn|djot|tdƒ|ƒqDt|tdƒ||i |fƒqHntSd S( sBLookup URL "name" in the cache. Return the Cache object if found.is_nos CACHEUPDATE(s remote_times!timestamp did not change for "%s"iscannot get timestamp for "%s"s(timestamp for "%s" changed from %d to %dN(scacheshas_keysnamesentsupdatedscache_update_strs get_var_valsrecdictstimesltimes date2secssrtimesRemotes remote_timesrts msg_depends_smsg_infosNone(srecdictsnamescache_update_strsrtsents remote_time((s*/mnt/gmirror/ports/devel/aap/work/Cache.pys cache_lookup\s,      %cCs,dkl}||ƒ\} }| djo&tiitii|ƒƒdfSnt |ƒ o&tiitii|ƒƒdfSnt i i dƒ ot |ƒnt|d|ƒt|||ƒ}|oR|iƒ}tii|ƒo&tiƒ|_d|_|dfSnd|_ntƒo%t|tdƒ|ƒtdfSntii|ƒ}t i!|dƒ}|djo d }n ||}d k$}xgt%|ƒD]Y} tii| ƒ o«d }xqt(ƒt i)gD]]} | oPt+| ƒ}t+| ƒ|jo| | | jo| |d jo | }Pq>qáqáW| oq®nyti-| ƒWqsq®qsXnx«no£t.|i/dd ƒƒ|}tii0| |ƒ}y5ti1|ti2ti3ti4ƒ} ti6| ƒPWqvt7j o*\} }| t:i;jo d }PqqvXq}W|oßyt<|||ƒ\}}WnLt7j o@}t@|td ƒ|t.|ƒfƒtA|ƒtdfSnXtii0| tBƒ}tD|||tiiE|ƒtiƒƒtF|