1 |
Author: grobian |
2 |
Date: 2008-07-28 17:52:55 +0000 (Mon, 28 Jul 2008) |
3 |
New Revision: 11240 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/pym/portage/__init__.py |
7 |
Log: |
8 |
Original commit: |
9 |
|
10 |
| 11233 | Add support for an new EAPI="2_pre0" value so that people | |
11 |
| zmedico | who want to test USE deps can set the EAPI to something | |
12 |
| | other than 0 or 1. We can support as many different | |
13 |
| | experimental EAPI values as we need, and drop support for | |
14 |
| | them when the final EAPI 2 is defined. | |
15 |
|
16 |
Changed into a Prefix enabled version, which is more generic. It build |
17 |
further on the idea that multiple properties are being present in EAPI. |
18 |
I split it up in "should have" properties ("prefix" for now) that must |
19 |
be present, and "can have" properties, that may be present. This |
20 |
patch is not perfect (can have EAPI="prefix 2_pre0 1 0") but fixing that |
21 |
requires more thinking (successing properties, conflicting |
22 |
properties...) |
23 |
|
24 |
|
25 |
|
26 |
Modified: main/branches/prefix/pym/portage/__init__.py |
27 |
=================================================================== |
28 |
--- main/branches/prefix/pym/portage/__init__.py 2008-07-28 17:48:47 UTC (rev 11239) |
29 |
+++ main/branches/prefix/pym/portage/__init__.py 2008-07-28 17:52:55 UTC (rev 11240) |
30 |
@@ -4496,9 +4496,6 @@ |
31 |
eerror(l, phase=mydo, key=mysettings.mycpv) |
32 |
return rval |
33 |
|
34 |
-_eapi_prefix_re = re.compile("(^|\s*)%s($|\s*)" % portage.const.EAPIPREFIX) |
35 |
-_eapi_num_re = re.compile("(^|\s*)[0-9]+($|\s*)") |
36 |
- |
37 |
def eapi_is_supported(eapi): |
38 |
# PREFIX HACK/EXTENSION: in prefix we have "incompatible" ebuilds in |
39 |
# an consistent manner; regardless what the EAPI of the main tree |
40 |
@@ -4514,22 +4511,27 @@ |
41 |
# However, back to reality, we just look for all <desc> we require, |
42 |
# and don't do version tricks other than the main tree does. |
43 |
|
44 |
- eapi = str(eapi) |
45 |
+ eapi = str(eapi).split() # note Python's contact for this special case |
46 |
+ |
47 |
+ # these are the properties that MUST be present (should) |
48 |
+ properties = [] |
49 |
if portage.const.EAPIPREFIX: |
50 |
- if not _eapi_prefix_re.search(eapi): |
51 |
+ properties.append(portage.const.EAPIPREFIX) # clumpsy temporary solution |
52 |
+ |
53 |
+ for prop in properties: |
54 |
+ if prop not in eapi: |
55 |
return False |
56 |
+ else: |
57 |
+ eapi.remove(prop) |
58 |
+ |
59 |
+ # now check if what's left is supported (can) |
60 |
+ properties = [ "2_pre0" ] # another clumpsy solution |
61 |
+ for i in range(portage.const.EAPI): |
62 |
+ propeties.append(str(i)) |
63 |
|
64 |
- m = _eapi_num_re.search(eapi) |
65 |
- if not m: |
66 |
- eapi = 0 |
67 |
- else: |
68 |
- try: |
69 |
- eapi = int(m.string[m.start():m.end()].strip()) |
70 |
- except ValueError: |
71 |
- eapi = -1 |
72 |
- if eapi < 0: |
73 |
- return False |
74 |
- return eapi <= portage.const.EAPI |
75 |
+ for v in eapi: |
76 |
+ if v not in properties |
77 |
+ return False |
78 |
|
79 |
def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, mydbapi): |