1 |
Author: zmedico |
2 |
Date: 2008-11-24 00:51:09 +0000 (Mon, 24 Nov 2008) |
3 |
New Revision: 12069 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/pym/portage/__init__.py |
7 |
Log: |
8 |
Add support for parsing EAPI labels in contained in 'eapi' files in the |
9 |
profiles, and bail out if the profile contains an unsupported EAPI value |
10 |
in any one of it's directories. We don't necessarily have to use this but |
11 |
at least it gives us some way to make emerge bail out early if a profile |
12 |
contains unsupported EAPI features. (trunk r12068) |
13 |
|
14 |
|
15 |
Modified: main/branches/2.1.6/pym/portage/__init__.py |
16 |
=================================================================== |
17 |
--- main/branches/2.1.6/pym/portage/__init__.py 2008-11-24 00:50:07 UTC (rev 12068) |
18 |
+++ main/branches/2.1.6/pym/portage/__init__.py 2008-11-24 00:51:09 UTC (rev 12069) |
19 |
@@ -1197,6 +1197,17 @@ |
20 |
self.profiles = [] |
21 |
def addProfile(currentPath): |
22 |
parentsFile = os.path.join(currentPath, "parent") |
23 |
+ eapi_file = os.path.join(currentPath, "eapi") |
24 |
+ try: |
25 |
+ eapi = open(eapi_file).readline().strip() |
26 |
+ except IOError: |
27 |
+ pass |
28 |
+ else: |
29 |
+ if not eapi_is_supported(eapi): |
30 |
+ raise portage.exception.ParseError( |
31 |
+ "Profile contains unsupported " + \ |
32 |
+ "EAPI '%s': '%s'" % \ |
33 |
+ (eapi, os.path.realpath(eapi_file),)) |
34 |
if os.path.exists(parentsFile): |
35 |
parents = grabfile(parentsFile) |
36 |
if not parents: |