1 |
Suggested-by: Zac Medico <zmedico@g.o> |
2 |
Acked-by: Michael Everitt <m.j.everitt@×××.org> |
3 |
Bug: https://bugs.gentoo.org/668538 |
4 |
--- |
5 |
lib/portage/package/ebuild/config.py | 11 +++++++++++ |
6 |
1 file changed, 11 insertions(+) |
7 |
|
8 |
diff --git a/lib/portage/package/ebuild/config.py b/lib/portage/package/ebuild/config.py |
9 |
index a68df5807..5c1404389 100644 |
10 |
--- a/lib/portage/package/ebuild/config.py |
11 |
+++ b/lib/portage/package/ebuild/config.py |
12 |
@@ -155,6 +155,9 @@ class config(object): |
13 |
_constant_keys = frozenset(['PORTAGE_BIN_PATH', 'PORTAGE_GID', |
14 |
'PORTAGE_PYM_PATH', 'PORTAGE_PYTHONPATH']) |
15 |
|
16 |
+ _deprecated_keys = {'PORTAGE_LOGDIR': 'PORT_LOGDIR', |
17 |
+ 'PORTAGE_LOGDIR_CLEAN': 'PORT_LOGDIR_CLEAN'} |
18 |
+ |
19 |
_setcpv_aux_keys = ('BDEPEND', 'DEFINED_PHASES', 'DEPEND', 'EAPI', 'HDEPEND', |
20 |
'INHERITED', 'IUSE', 'REQUIRED_USE', 'KEYWORDS', 'LICENSE', 'PDEPEND', |
21 |
'PROPERTIES', 'RDEPEND', 'SLOT', |
22 |
@@ -2653,6 +2656,14 @@ class config(object): |
23 |
except KeyError: |
24 |
pass |
25 |
|
26 |
+ deprecated_key = self._deprecated_keys.get(mykey) |
27 |
+ if deprecated_key is not None: |
28 |
+ value = self._getitem(deprecated_key) |
29 |
+ warnings.warn(_("Key %s has been renamed to %s. Please ", |
30 |
+ "update your configuration") % (deprecated_key, mykey), |
31 |
+ UserWarning) |
32 |
+ return value |
33 |
+ |
34 |
raise KeyError(mykey) |
35 |
|
36 |
def get(self, k, x=None): |
37 |
-- |
38 |
2.13.6 |