diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-11-24 00:50:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-11-24 00:50:07 +0000 |
commit | ad887a7f02f1673fa7967729a56e31ce9a2abd7b (patch) | |
tree | 13d6bc47dbdb922c9051ae96238cf465bbe83e1d | |
parent | c3dcf30bb8df1997b3bc594fba0184c765c66281 (diff) | |
download | portage-ad887a7f02f1673fa7967729a56e31ce9a2abd7b.tar.gz portage-ad887a7f02f1673fa7967729a56e31ce9a2abd7b.tar.bz2 portage-ad887a7f02f1673fa7967729a56e31ce9a2abd7b.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.
svn path=/main/trunk/; revision=12068
-rw-r--r-- | pym/portage/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index c12f58056..471e74365 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: |