if not (dest['_mtime_'] == src['_mtime_'] and \
tree_data.eclass_db.validate_and_rewrite_cache(
dest['_eclasses_'], tree_data.dest_db.validation_chf,
- tree_data.dest_db.store_eclass_paths) and \
+ tree_data.dest_db.store_eclass_paths) is not None and \
set(dest['_eclasses_']) == set(src['_eclasses_'])):
dest = None
else:
continue
if eclasses is not None:
- if not tree_data.eclass_db.validate_and_rewrite_cache(
+ if tree_data.eclass_db.validate_and_rewrite_cache(
src['_eclasses_'], tree_data.src_db.validation_chf,
- tree_data.src_db.store_eclass_paths):
+ tree_data.src_db.store_eclass_paths) is None:
continue
inherited = eclasses
else:
self._eclass_locations[ys] = x
def validate_and_rewrite_cache(self, ec_dict, chf_type, stores_paths):
+ """
+ This will return an empty dict if the ec_dict parameter happens
+ to be empty, therefore callers must take care to distinguish
+ between empty dict and None return values.
+ """
if not isinstance(ec_dict, dict):
return None
our_getter = operator.attrgetter(chf_type)