summaryrefslogtreecommitdiffstats
path: root/pym/eclass_cache.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-25 21:44:04 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-25 21:44:04 +0000
commit71c816041e5edf96c7e60898cd178976856e55a0 (patch)
tree76030b645204e5087b99ed51739fa5b1763108f0 /pym/eclass_cache.py
parentc749106db3d5cb9c47527ccf980458a256a36e87 (diff)
downloadportage-71c816041e5edf96c7e60898cd178976856e55a0.tar.gz
portage-71c816041e5edf96c7e60898cd178976856e55a0.tar.bz2
portage-71c816041e5edf96c7e60898cd178976856e55a0.zip
For full compatibility with older versions of portage, write the path in the serialized _eclasses_ when possible.
svn path=/main/trunk/; revision=4818
Diffstat (limited to 'pym/eclass_cache.py')
-rw-r--r--pym/eclass_cache.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/eclass_cache.py b/pym/eclass_cache.py
index 904e63261..6b4f87cd6 100644
--- a/pym/eclass_cache.py
+++ b/pym/eclass_cache.py
@@ -50,14 +50,19 @@ class cache:
except OSError:
continue
ys=y[:-eclass_len]
- self.eclasses[ys] = long(mtime)
+ self.eclasses[ys] = (x, long(mtime))
self._eclass_locations[ys] = x
def is_eclass_data_valid(self, ec_dict):
if not isinstance(ec_dict, dict):
return False
for eclass, mtime in ec_dict.iteritems():
- if eclass not in self.eclasses or mtime != self.eclasses[eclass]:
+ cached_data = self.eclasses.get(eclass, None)
+ """ Only use the mtime for validation since the probability of a
+ collision is small and, depending on the cache implementation, the
+ path may not be specified (cache from rsync mirrors, for example).
+ """
+ if cached_data is None or mtime != cached_data[1]:
return False
return True