Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12068 - main/trunk/pym/portage
Date: Mon, 24 Nov 2008 00:50:11
Message-Id: E1L4PeR-0003pn-LD@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-11-24 00:50:07 +0000 (Mon, 24 Nov 2008)
3 New Revision: 12068
4
5 Modified:
6 main/trunk/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.
13
14
15 Modified: main/trunk/pym/portage/__init__.py
16 ===================================================================
17 --- main/trunk/pym/portage/__init__.py 2008-11-24 00:34:17 UTC (rev 12067)
18 +++ main/trunk/pym/portage/__init__.py 2008-11-24 00:50:07 UTC (rev 12068)
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: