summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-29 15:43:35 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-29 15:43:35 -0700
commitfea1962b7e8df9a8568b009a8f52b3c8ade67043 (patch)
tree019b527adf4b611d0041fc84541bc859e7f45d10 /pym
parent1811def4b0ebc8af2280dde7f84331301b4eddd3 (diff)
downloadportage-fea1962b7e8df9a8568b009a8f52b3c8ade67043.tar.gz
portage-fea1962b7e8df9a8568b009a8f52b3c8ade67043.tar.bz2
portage-fea1962b7e8df9a8568b009a8f52b3c8ade67043.zip
action_metadata: clean up src entry validation
This eliminates a bunch of redundant eclasses code that we handle with template.validate_entry() instead.
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/actions.py44
1 files changed, 10 insertions, 34 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 036b471a1..7a1bcb5f8 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1732,6 +1732,13 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
continue
ebuild_hash = hashed_path(ebuild_location)
+ try:
+ if not tree_data.src_db.validate_entry(src,
+ ebuild_hash, tree_data.eclass_db):
+ continue
+ except CacheError:
+ continue
+
eapi = src.get('EAPI')
if not eapi:
eapi = '0'
@@ -1758,6 +1765,9 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
if src_chf != dest_chf:
# populate src entry with dest_chf_key
+ # (the validity of the dest_chf that we generate from the
+ # ebuild here relies on the fact that we already used
+ # validate_entry to validate the ebuild with src_chf)
src[dest_chf_key] = dest_chf_getter(ebuild_hash)
if dest is not None:
@@ -1781,40 +1791,6 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
# so there's no need to overwrite it.
continue
- try:
- inherited = src.get('INHERITED', '')
- eclasses = src.get('_eclasses_')
- except CacheError:
- continue
-
- if eclasses is not None:
- if tree_data.eclass_db.validate_and_rewrite_cache(
- src['_eclasses_'], tree_data.src_db.validation_chf,
- tree_data.src_db.store_eclass_paths) is None:
- continue
- inherited = eclasses
- else:
- inherited = inherited.split()
-
- if tree_data.src_db.complete_eclass_entries and \
- eclasses is None:
- continue
-
- if inherited:
- # Even if _eclasses_ already exists, replace it with data from
- # eclass_cache, in order to insert local eclass paths.
- try:
- eclasses = tree_data.eclass_db.get_eclass_data(inherited)
- except KeyError:
- # INHERITED contains a non-existent eclass.
- continue
-
- if eclasses is None:
- continue
- src['_eclasses_'] = eclasses
- else:
- src['_eclasses_'] = {}
-
if not eapi_supported:
src = {
'EAPI' : '-' + eapi,