summaryrefslogtreecommitdiffstats
path: root/pym/portage/cache
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-23 21:16:27 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-23 21:16:27 +0000
commitff7cdd18aa9fe95be848637366b4b7fcaf440f6f (patch)
treed9fc884e0b1e152cffb4c222ad22fb0025e8c9ce /pym/portage/cache
parent1243f8021a2f0b3ed5cdb2060d67f6d3905e3d4e (diff)
downloadportage-ff7cdd18aa9fe95be848637366b4b7fcaf440f6f.tar.gz
portage-ff7cdd18aa9fe95be848637366b4b7fcaf440f6f.tar.bz2
portage-ff7cdd18aa9fe95be848637366b4b7fcaf440f6f.zip
Add support for FEATURES=parse-eapi-ebuild-head, which is similar to GLEP 55
except that the EAPI is parsed from the head of the ebuild (first 30 lines). This feature is only intended for experimental purposes and should not be enabled under normal circumstances. svn path=/main/trunk/; revision=13173
Diffstat (limited to 'pym/portage/cache')
-rw-r--r--pym/portage/cache/util.py21
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)