# $Id$
import os, re, stat, types
-from portage.cache import flat_hash
+from portage.cache import cache_errors, flat_hash
import portage.eclass_cache
from portage.cache.template import reconstruct_eclasses
from portage.cache.mappings import ProtectedDict
if "_eclasses_" not in d:
if "INHERITED" in d:
- d["_eclasses_"] = self.ec.get_eclass_data(d["INHERITED"].split(), from_master_only=True)
+ try:
+ d["_eclasses_"] = self.ec.get_eclass_data(
+ d["INHERITED"].split(), from_master_only=True)
+ except KeyError, e:
+ # INHERITED contains a non-existent eclass.
+ raise cache_errors.CacheCorruption(cpv, e)
del d["INHERITED"]
else:
d["_eclasses_"] = {}
# Even if _eclasses_ already exists, replace it with data from
# eclass_cache, in order to insert local eclass paths.
- eclasses = eclass_cache.get_eclass_data(inherited,
- from_master_only=True)
+ try:
+ eclasses = eclass_cache.get_eclass_data(inherited,
+ from_master_only=True)
+ except KeyError:
+ # INHERITED contains a non-existent eclass.
+ noise.eclass_stale(x)
+ continue
+
if eclasses is None:
noise.eclass_stale(x)
continue
def get_eclass_data(self, inherits, from_master_only=False):
ec_dict = {}
for x in inherits:
- try:
- ec_dict[x] = self.eclasses[x]
- except KeyError:
- print "ec=",ec_dict
- print "inherits=",inherits
- raise
+ ec_dict[x] = self.eclasses[x]
if from_master_only and \
self._eclass_locations[x] != self._master_eclass_root:
return None