1 |
commit: fea1962b7e8df9a8568b009a8f52b3c8ade67043 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 29 22:43:35 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 29 22:43:35 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fea1962b |
7 |
|
8 |
action_metadata: clean up src entry validation |
9 |
|
10 |
This eliminates a bunch of redundant eclasses code that we handle with |
11 |
template.validate_entry() instead. |
12 |
|
13 |
--- |
14 |
pym/_emerge/actions.py | 44 ++++++++++---------------------------------- |
15 |
1 files changed, 10 insertions(+), 34 deletions(-) |
16 |
|
17 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
18 |
index 036b471..7a1bcb5 100644 |
19 |
--- a/pym/_emerge/actions.py |
20 |
+++ b/pym/_emerge/actions.py |
21 |
@@ -1732,6 +1732,13 @@ def action_metadata(settings, portdb, myopts, porttrees=None): |
22 |
continue |
23 |
ebuild_hash = hashed_path(ebuild_location) |
24 |
|
25 |
+ try: |
26 |
+ if not tree_data.src_db.validate_entry(src, |
27 |
+ ebuild_hash, tree_data.eclass_db): |
28 |
+ continue |
29 |
+ except CacheError: |
30 |
+ continue |
31 |
+ |
32 |
eapi = src.get('EAPI') |
33 |
if not eapi: |
34 |
eapi = '0' |
35 |
@@ -1758,6 +1765,9 @@ def action_metadata(settings, portdb, myopts, porttrees=None): |
36 |
|
37 |
if src_chf != dest_chf: |
38 |
# populate src entry with dest_chf_key |
39 |
+ # (the validity of the dest_chf that we generate from the |
40 |
+ # ebuild here relies on the fact that we already used |
41 |
+ # validate_entry to validate the ebuild with src_chf) |
42 |
src[dest_chf_key] = dest_chf_getter(ebuild_hash) |
43 |
|
44 |
if dest is not None: |
45 |
@@ -1781,40 +1791,6 @@ def action_metadata(settings, portdb, myopts, porttrees=None): |
46 |
# so there's no need to overwrite it. |
47 |
continue |
48 |
|
49 |
- try: |
50 |
- inherited = src.get('INHERITED', '') |
51 |
- eclasses = src.get('_eclasses_') |
52 |
- except CacheError: |
53 |
- continue |
54 |
- |
55 |
- if eclasses is not None: |
56 |
- if tree_data.eclass_db.validate_and_rewrite_cache( |
57 |
- src['_eclasses_'], tree_data.src_db.validation_chf, |
58 |
- tree_data.src_db.store_eclass_paths) is None: |
59 |
- continue |
60 |
- inherited = eclasses |
61 |
- else: |
62 |
- inherited = inherited.split() |
63 |
- |
64 |
- if tree_data.src_db.complete_eclass_entries and \ |
65 |
- eclasses is None: |
66 |
- continue |
67 |
- |
68 |
- if inherited: |
69 |
- # Even if _eclasses_ already exists, replace it with data from |
70 |
- # eclass_cache, in order to insert local eclass paths. |
71 |
- try: |
72 |
- eclasses = tree_data.eclass_db.get_eclass_data(inherited) |
73 |
- except KeyError: |
74 |
- # INHERITED contains a non-existent eclass. |
75 |
- continue |
76 |
- |
77 |
- if eclasses is None: |
78 |
- continue |
79 |
- src['_eclasses_'] = eclasses |
80 |
- else: |
81 |
- src['_eclasses_'] = {} |
82 |
- |
83 |
if not eapi_supported: |
84 |
src = { |
85 |
'EAPI' : '-' + eapi, |