summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-24 00:51:09 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-24 00:51:09 +0000
commit3e740be59b488f5c36c9dba7948e91f4b991c1a9 (patch)
tree0b9d3a7beb2b7874eba5d69492ed984d1d47edcc
parentea61f3589be3ca08638d0cb548dad746e5ba2dff (diff)
downloadportage-3e740be59b488f5c36c9dba7948e91f4b991c1a9.tar.gz
portage-3e740be59b488f5c36c9dba7948e91f4b991c1a9.tar.bz2
portage-3e740be59b488f5c36c9dba7948e91f4b991c1a9.zip
Add support for parsing EAPI labels in contained in 'eapi' files in the
profiles, and bail out if the profile contains an unsupported EAPI value in any one of it's directories. We don't necessarily have to use this but at least it gives us some way to make emerge bail out early if a profile contains unsupported EAPI features. (trunk r12068) svn path=/main/branches/2.1.6/; revision=12069
-rw-r--r--pym/portage/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 929b82ad2..858bf768d 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1197,6 +1197,17 @@ class config(object):
self.profiles = []
def addProfile(currentPath):
parentsFile = os.path.join(currentPath, "parent")
+ eapi_file = os.path.join(currentPath, "eapi")
+ try:
+ eapi = open(eapi_file).readline().strip()
+ except IOError:
+ pass
+ else:
+ if not eapi_is_supported(eapi):
+ raise portage.exception.ParseError(
+ "Profile contains unsupported " + \
+ "EAPI '%s': '%s'" % \
+ (eapi, os.path.realpath(eapi_file),))
if os.path.exists(parentsFile):
parents = grabfile(parentsFile)
if not parents: