1 |
commit: 86d403b7707e15059afa36db4576b4771012c86b |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 31 11:39:47 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 31 00:06:33 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86d403b7 |
7 |
|
8 |
python-utils-r1.eclass: Disable py2.7, except for p-any-r1 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
eclass/python-any-r1.eclass | 1 + |
13 |
eclass/python-utils-r1.eclass | 11 ++++++++--- |
14 |
2 files changed, 9 insertions(+), 3 deletions(-) |
15 |
|
16 |
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass |
17 |
index 5f2dc5b8f38..313fe6b40df 100644 |
18 |
--- a/eclass/python-any-r1.eclass |
19 |
+++ b/eclass/python-any-r1.eclass |
20 |
@@ -174,6 +174,7 @@ _python_any_set_globals() { |
21 |
local usestr deps i PYTHON_PKG_DEP |
22 |
[[ ${PYTHON_REQ_USE} ]] && usestr="[${PYTHON_REQ_USE}]" |
23 |
|
24 |
+ _PYTHON_ALLOW_PY27=1 \ |
25 |
_python_set_impls |
26 |
|
27 |
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do |
28 |
|
29 |
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass |
30 |
index 6d482aa106c..dcc441b8209 100644 |
31 |
--- a/eclass/python-utils-r1.eclass |
32 |
+++ b/eclass/python-utils-r1.eclass |
33 |
@@ -40,7 +40,6 @@ inherit toolchain-funcs |
34 |
# All supported Python implementations, most preferred last. |
35 |
_PYTHON_ALL_IMPLS=( |
36 |
pypy3 |
37 |
- python2_7 |
38 |
python3_7 python3_8 python3_9 |
39 |
) |
40 |
readonly _PYTHON_ALL_IMPLS |
41 |
@@ -52,7 +51,7 @@ readonly _PYTHON_ALL_IMPLS |
42 |
_PYTHON_HISTORICAL_IMPLS=( |
43 |
jython2_7 |
44 |
pypy pypy1_{8,9} pypy2_0 |
45 |
- python2_{5,6} |
46 |
+ python2_{5..7} |
47 |
python3_{1..6} |
48 |
) |
49 |
readonly _PYTHON_HISTORICAL_IMPLS |
50 |
@@ -149,7 +148,13 @@ _python_set_impls() { |
51 |
done |
52 |
|
53 |
if [[ ! ${supp[@]} ]]; then |
54 |
- die "No supported implementation in PYTHON_COMPAT." |
55 |
+ # special-case python2_7 for python-any-r1 |
56 |
+ if [[ ${_PYTHON_ALLOW_PY27} ]] && has python2_7 "${PYTHON_COMPAT[@]}" |
57 |
+ then |
58 |
+ supp+=( python2_7 ) |
59 |
+ else |
60 |
+ die "No supported implementation in PYTHON_COMPAT." |
61 |
+ fi |
62 |
fi |
63 |
|
64 |
if [[ ${_PYTHON_SUPPORTED_IMPLS[@]} ]]; then |