diff options
Diffstat (limited to 'pym/portage/cache/util.py')
-rw-r--r-- | pym/portage/cache/util.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pym/portage/cache/util.py b/pym/portage/cache/util.py index 9fcd4b49b..0f2685c0a 100644 --- a/pym/portage/cache/util.py +++ b/pym/portage/cache/util.py @@ -10,7 +10,8 @@ from portage.cache import cache_errors def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None): - from portage import eapi_is_supported + from portage import eapi_is_supported, \ + _validate_cache_for_unsupported_eapis if not src_cache.complete_eclass_entries and not eclass_cache: raise Exception("eclass_cache required for cache's of class %s!" % src_cache.__class__) @@ -39,6 +40,17 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, noise.exception(x, ce) del ce continue + + eapi = entry.get('EAPI') + if not eapi: + eapi = '0' + eapi = eapi.lstrip('-') + eapi_supported = eapi_is_supported(eapi) + if not eapi_supported: + if not _validate_cache_for_unsupported_eapis: + noise.misc(x, "unable to validate cache for EAPI='%s'" % eapi) + continue + write_it = True trg = None try: @@ -102,13 +114,10 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, continue entry["_eclasses_"] = eclasses - eapi = entry.get("EAPI") - if not eapi: - eapi = "0" - if not eapi_is_supported(eapi): + if not eapi_supported: for k in set(entry).difference(("_mtime_", "_eclasses_")): entry[k] = "" - entry["EAPI"] = "-" + eapi.lstrip("-") + entry["EAPI"] = "-" + eapi # by this time, if it reaches here, the eclass has been validated, and the entry has # been updated/translated (if needs be, for metadata/cache mainly) |