1 |
Author: zmedico |
2 |
Date: 2008-09-27 19:24:10 +0000 (Sat, 27 Sep 2008) |
3 |
New Revision: 11573 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
main/trunk/pym/portage/__init__.py |
8 |
main/trunk/pym/portage/dbapi/porttree.py |
9 |
Log: |
10 |
Mask packages with deprecated EAPIs in order to prevent them from being |
11 |
installed. Such packages will still behave normally if they are already |
12 |
installed, but preventing new installation will remind people to update |
13 |
the EAPIs in their overlays if necessary. |
14 |
|
15 |
|
16 |
Modified: main/trunk/pym/_emerge/__init__.py |
17 |
=================================================================== |
18 |
--- main/trunk/pym/_emerge/__init__.py 2008-09-27 16:14:37 UTC (rev 11572) |
19 |
+++ main/trunk/pym/_emerge/__init__.py 2008-09-27 19:24:10 UTC (rev 11573) |
20 |
@@ -1245,11 +1245,14 @@ |
21 |
if pkg.built and not pkg.installed and "CHOST" in pkg.metadata: |
22 |
if not pkgsettings._accept_chost(pkg): |
23 |
return False |
24 |
- if not portage.eapi_is_supported(pkg.metadata["EAPI"]): |
25 |
+ eapi = pkg.metadata["EAPI"] |
26 |
+ if not portage.eapi_is_supported(eapi): |
27 |
return False |
28 |
- if not pkg.installed and \ |
29 |
- pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata): |
30 |
- return False |
31 |
+ if not pkg.installed: |
32 |
+ if portage._eapi_is_deprecated(eapi): |
33 |
+ return False |
34 |
+ if pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata): |
35 |
+ return False |
36 |
if pkgsettings._getMaskAtom(pkg.cpv, pkg.metadata): |
37 |
return False |
38 |
if pkgsettings._getProfileMaskAtom(pkg.cpv, pkg.metadata): |
39 |
|
40 |
Modified: main/trunk/pym/portage/__init__.py |
41 |
=================================================================== |
42 |
--- main/trunk/pym/portage/__init__.py 2008-09-27 16:14:37 UTC (rev 11572) |
43 |
+++ main/trunk/pym/portage/__init__.py 2008-09-27 19:24:10 UTC (rev 11573) |
44 |
@@ -4578,10 +4578,15 @@ |
45 |
eerror(l, phase=mydo, key=mysettings.mycpv) |
46 |
return rval |
47 |
|
48 |
+_deprecated_eapis = frozenset(["2_pre3", "2_pre2", "2_pre1"]) |
49 |
+ |
50 |
+def _eapi_is_deprecated(eapi): |
51 |
+ return eapi in _deprecated_eapis |
52 |
+ |
53 |
def eapi_is_supported(eapi): |
54 |
eapi = str(eapi).strip() |
55 |
|
56 |
- if eapi in ("2_pre3", "2_pre2", "2_pre1"): |
57 |
+ if _eapi_is_deprecated(eapi): |
58 |
return True |
59 |
|
60 |
try: |
61 |
@@ -6758,6 +6763,8 @@ |
62 |
eapi = eapi[1:] |
63 |
if not eapi_is_supported(eapi): |
64 |
return ["EAPI %s" % eapi] |
65 |
+ elif _eapi_is_deprecated(eapi) and not installed: |
66 |
+ return ["EAPI %s" % eapi] |
67 |
egroups = settings.configdict["backupenv"].get( |
68 |
"ACCEPT_KEYWORDS", "").split() |
69 |
mygroups = mygroups.split() |
70 |
|
71 |
Modified: main/trunk/pym/portage/dbapi/porttree.py |
72 |
=================================================================== |
73 |
--- main/trunk/pym/portage/dbapi/porttree.py 2008-09-27 16:14:37 UTC (rev 11572) |
74 |
+++ main/trunk/pym/portage/dbapi/porttree.py 2008-09-27 19:24:10 UTC (rev 11573) |
75 |
@@ -20,7 +20,8 @@ |
76 |
import portage.gpg, portage.checksum |
77 |
|
78 |
from portage import eclass_cache, auxdbkeys, doebuild, flatten, \ |
79 |
- listdir, dep_expand, eapi_is_supported, key_expand, dep_check |
80 |
+ listdir, dep_expand, eapi_is_supported, key_expand, dep_check, \ |
81 |
+ _eapi_is_deprecated |
82 |
|
83 |
import os, stat |
84 |
from itertools import izip |
85 |
@@ -917,8 +918,11 @@ |
86 |
writemsg("!!! %s\n" % str(e), noiselevel=-1) |
87 |
del e |
88 |
continue |
89 |
- if not eapi_is_supported(metadata["EAPI"]): |
90 |
+ eapi = metadata["EAPI"] |
91 |
+ if not eapi_is_supported(eapi): |
92 |
continue |
93 |
+ if _eapi_is_deprecated(eapi): |
94 |
+ continue |
95 |
if self.mysettings._getMissingKeywords(mycpv, metadata): |
96 |
continue |
97 |
if local_config: |