Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 76040 Details for
Bug 90518
Make metadata updating optional after sync
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch from Zac Medico that uses ${PORTDIR}/metadata instead of local cache.
portage-2.1-metadb.patch (text/plain), 2.88 KB, created by
Alec Warner (RETIRED)
on 2006-01-02 20:51:16 UTC
(
hide
)
Description:
Patch from Zac Medico that uses ${PORTDIR}/metadata instead of local cache.
Filename:
MIME Type:
Creator:
Alec Warner (RETIRED)
Created:
2006-01-02 20:51:16 UTC
Size:
2.88 KB
patch
obsolete
>Index: portage-2.1_pre3/pym/cache/util.py >=================================================================== >--- portage-2.1_pre3.orig/pym/cache/util.py >+++ portage-2.1_pre3/pym/cache/util.py >@@ -101,3 +101,13 @@ class non_quiet_mirroring(quiet_mirrorin > def corruption(self,key,*arg): print "corrupt %s:" % key,arg > def eclass_stale(self,key,*arg):print "stale %s:"%key,arg > >+def is_cache_valid(emtime, eclasses, mydata): >+ if emtime != long(mydata.get("_mtime_", 0)): >+ return False >+ ec_dict = mydata.get("_eclasses_", []) >+ if len(ec_dict) == 0: >+ return True >+ for eclass, tup in ec_dict.iteritems(): >+ if eclass not in eclasses or tuple(tup) != eclasses[eclass]: >+ return False >+ return True >Index: portage-2.1_pre3/pym/portage.py >=================================================================== >--- portage-2.1_pre3.orig/pym/portage.py >+++ portage-2.1_pre3/pym/portage.py >@@ -29,6 +29,7 @@ try: > from time import sleep > from random import shuffle > from cache.cache_errors import CacheError >+ from cache.util import is_cache_valid > except SystemExit, e: > raise > except Exception, e: >@@ -4721,7 +4722,12 @@ class portdbapi(dbapi): > for x in self.porttrees: > # location, label, auxdbkeys > self.auxdb[x] = self.auxdbmodule(portage_const.DEPCACHE_PATH, x, filtered_auxdbkeys, gid=portage_gid) >- >+ >+ if "metadb" in self.mysettings.features: >+ for x in self.porttrees: >+ if os.path.exists(x+"/metadata/cache"): >+ self.metadb[x]=self.metadbmodule(x, "metadata/cache", auxdbkeys) >+ > def close_caches(self): > for x in self.auxdb.keys(): > self.auxdb[x].sync() >@@ -4825,14 +4831,16 @@ class portdbapi(dbapi): > raise KeyError > > try: >- mydata = self.auxdb[mylocation][mycpv] >- if emtime != long(mydata.get("_mtime_", 0)): >- doregen = True >- elif len(mydata.get("_eclasses_", [])) > 0: >- doregen = not self.eclassdb.is_eclass_data_valid(mydata["_eclasses_"]) >- else: >- doregen = False >- >+ mydata=None >+ doregen=False >+ if self.metadb.has_key(mylocation): >+ try: >+ mydata = self.metadb[mylocation][mycpv] >+ except (KeyError, CacheError): >+ pass >+ if not mydata or not is_cache_valid(emtime, self.eclassdb.eclasses, mydata): >+ mydata = self.auxdb[mylocation][mycpv] >+ doregen = not is_cache_valid(emtime, self.eclassdb.eclasses, mydata) > except KeyError: > doregen = True > except CacheError: >Index: portage-2.1_pre3/bin/emerge >=================================================================== >--- portage-2.1_pre3.orig/bin/emerge >+++ portage-2.1_pre3/bin/emerge >@@ -2768,6 +2768,10 @@ if myaction in ["sync","rsync","metadata > except: > pass > >+ if updatecache_flg and "metadb" in portage.features: >+ updatecache_flg=False >+ print "!!! Skipping metadata transfer because metadb is in FEATURES." >+ > if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg: > if "--quiet" not in myopts: > print "\n>>> Updating Portage cache: ",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 90518
: 76040