Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 90518
Collapse All | Expand All

(-)portage-2.1_pre3/pym/cache/util.py (+10 lines)
Lines 101-103 class non_quiet_mirroring(quiet_mirrorin Link Here
101
	def corruption(self,key,*arg):	print "corrupt %s:" % key,arg
101
	def corruption(self,key,*arg):	print "corrupt %s:" % key,arg
102
	def eclass_stale(self,key,*arg):print "stale %s:"%key,arg
102
	def eclass_stale(self,key,*arg):print "stale %s:"%key,arg
103
103
104
def is_cache_valid(emtime, eclasses, mydata):
105
	if emtime != long(mydata.get("_mtime_", 0)):
106
		return False
107
	ec_dict = mydata.get("_eclasses_", [])
108
	if len(ec_dict) == 0:
109
		return True
110
	for eclass, tup in ec_dict.iteritems():
111
		if eclass not in eclasses or tuple(tup) != eclasses[eclass]:
112
			return False
113
	return True
(-)portage-2.1_pre3/pym/portage.py (-9 / +17 lines)
Lines 29-34 try: Link Here
29
	from time import sleep
29
	from time import sleep
30
	from random import shuffle
30
	from random import shuffle
31
	from cache.cache_errors import CacheError
31
	from cache.cache_errors import CacheError
32
	from cache.util import is_cache_valid
32
except SystemExit, e:
33
except SystemExit, e:
33
	raise
34
	raise
34
except Exception, e:
35
except Exception, e:
Lines 4721-4727 class portdbapi(dbapi): Link Here
4721
		for x in self.porttrees:
4722
		for x in self.porttrees:
4722
			# location, label, auxdbkeys
4723
			# location, label, auxdbkeys
4723
			self.auxdb[x] = self.auxdbmodule(portage_const.DEPCACHE_PATH, x, filtered_auxdbkeys, gid=portage_gid)
4724
			self.auxdb[x] = self.auxdbmodule(portage_const.DEPCACHE_PATH, x, filtered_auxdbkeys, gid=portage_gid)
4724
			
4725
4726
		if "metadb" in self.mysettings.features:
4727
			for x in self.porttrees:
4728
				if os.path.exists(x+"/metadata/cache"):
4729
					self.metadb[x]=self.metadbmodule(x, "metadata/cache", auxdbkeys)
4730
4725
	def close_caches(self):
4731
	def close_caches(self):
4726
		for x in self.auxdb.keys():
4732
		for x in self.auxdb.keys():
4727
			self.auxdb[x].sync()
4733
			self.auxdb[x].sync()
Lines 4825-4838 class portdbapi(dbapi): Link Here
4825
			raise KeyError
4831
			raise KeyError
4826
4832
4827
		try:
4833
		try:
4828
			mydata = self.auxdb[mylocation][mycpv]
4834
			mydata=None
4829
			if emtime != long(mydata.get("_mtime_", 0)):
4835
			doregen=False
4830
				doregen = True
4836
			if self.metadb.has_key(mylocation):
4831
			elif len(mydata.get("_eclasses_", [])) > 0:
4837
				try:
4832
				doregen = not self.eclassdb.is_eclass_data_valid(mydata["_eclasses_"])
4838
					mydata = self.metadb[mylocation][mycpv]
4833
			else:
4839
				except (KeyError, CacheError):
4834
				doregen = False
4840
					pass
4835
				
4841
			if not mydata or not is_cache_valid(emtime, self.eclassdb.eclasses, mydata):
4842
				mydata = self.auxdb[mylocation][mycpv]
4843
				doregen = not is_cache_valid(emtime, self.eclassdb.eclasses, mydata)
4836
		except KeyError:
4844
		except KeyError:
4837
			doregen = True
4845
			doregen = True
4838
		except CacheError:
4846
		except CacheError:
(-)portage-2.1_pre3/bin/emerge (+4 lines)
Lines 2768-2773 if myaction in ["sync","rsync","metadata Link Here
2768
	except:
2768
	except:
2769
		pass
2769
		pass
2770
2770
2771
	if updatecache_flg and "metadb" in portage.features:
2772
		updatecache_flg=False
2773
		print "!!! Skipping metadata transfer because metadb is in FEATURES."
2774
2771
	if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg:
2775
	if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg:
2772
		if "--quiet" not in myopts:
2776
		if "--quiet" not in myopts:
2773
			print "\n>>> Updating Portage cache:      ",
2777
			print "\n>>> Updating Portage cache:      ",

Return to bug 90518