1 |
commit: 038461565b477877de1ff09e282ca786ffbad8ce |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 30 00:48:32 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 30 12:58:49 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03846156 |
7 |
|
8 |
python-utils-r1.eclass: Constrain to EAPI >= 5 |
9 |
|
10 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
eclass/python-utils-r1.eclass | 37 +++++++++---------------------------- |
14 |
1 file changed, 9 insertions(+), 28 deletions(-) |
15 |
|
16 |
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass |
17 |
index 3eadc50f93e..e0711a35e3a 100644 |
18 |
--- a/eclass/python-utils-r1.eclass |
19 |
+++ b/eclass/python-utils-r1.eclass |
20 |
@@ -1,4 +1,4 @@ |
21 |
-# Copyright 1999-2018 Gentoo Foundation |
22 |
+# Copyright 1999-2019 Gentoo Authors |
23 |
# Distributed under the terms of the GNU General Public License v2 |
24 |
|
25 |
# @ECLASS: python-utils-r1.eclass |
26 |
@@ -7,7 +7,7 @@ |
27 |
# @AUTHOR: |
28 |
# Author: Michał Górny <mgorny@g.o> |
29 |
# Based on work of: Krzysztof Pawlik <nelchael@g.o> |
30 |
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 |
31 |
+# @SUPPORTED_EAPIS: 5 6 7 |
32 |
# @BLURB: Utility functions for packages with Python parts. |
33 |
# @DESCRIPTION: |
34 |
# A utility eclass providing functions to query Python implementations, |
35 |
@@ -20,11 +20,9 @@ |
36 |
# https://wiki.gentoo.org/wiki/Project:Python/python-utils-r1 |
37 |
|
38 |
case "${EAPI:-0}" in |
39 |
- 0|1|2|3|4|5|6|7) |
40 |
- ;; |
41 |
- *) |
42 |
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" |
43 |
- ;; |
44 |
+ [0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; |
45 |
+ [5-7]) ;; |
46 |
+ *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; |
47 |
esac |
48 |
|
49 |
if [[ ${_PYTHON_ECLASS_INHERITED} ]]; then |
50 |
@@ -33,7 +31,7 @@ fi |
51 |
|
52 |
if [[ ! ${_PYTHON_UTILS_R1} ]]; then |
53 |
|
54 |
-[[ ${EAPI:-0} == [012345] ]] && inherit eutils multilib |
55 |
+[[ ${EAPI} == 5 ]] && inherit eutils multilib |
56 |
inherit toolchain-funcs |
57 |
|
58 |
# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS |
59 |
@@ -80,17 +78,12 @@ _python_impl_supported() { |
60 |
# keep in sync with _PYTHON_ALL_IMPLS! |
61 |
# (not using that list because inline patterns shall be faster) |
62 |
case "${impl}" in |
63 |
- python2_7|python3_[5678]|jython2_7) |
64 |
+ python2_7|python3_[5678]|jython2_7|pypy|pypy3) |
65 |
return 0 |
66 |
;; |
67 |
pypy1_[89]|pypy2_0|python2_[56]|python3_[1234]) |
68 |
return 1 |
69 |
;; |
70 |
- pypy|pypy3) |
71 |
- if [[ ${EAPI:-0} == [01234] ]]; then |
72 |
- die "PyPy is supported in EAPI 5 and newer only." |
73 |
- fi |
74 |
- ;; |
75 |
*) |
76 |
[[ ${PYTHON_COMPAT_NO_STRICT} ]] && return 1 |
77 |
die "Invalid implementation in PYTHON_COMPAT: ${impl}" |
78 |
@@ -776,9 +769,6 @@ python_newexe() { |
79 |
|
80 |
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' |
81 |
[[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <path> <new-name>" |
82 |
- if [[ ${EAPI:-0} == [0123] ]]; then |
83 |
- die "python_do* and python_new* helpers are banned in EAPIs older than 4." |
84 |
- fi |
85 |
|
86 |
local wrapd=${python_scriptroot:-/usr/bin} |
87 |
|
88 |
@@ -906,9 +896,6 @@ python_domodule() { |
89 |
debug-print-function ${FUNCNAME} "${@}" |
90 |
|
91 |
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' |
92 |
- if [[ ${EAPI:-0} == [0123] ]]; then |
93 |
- die "python_do* and python_new* helpers are banned in EAPIs older than 4." |
94 |
- fi |
95 |
|
96 |
local d |
97 |
if [[ ${python_moduleroot} == /* ]]; then |
98 |
@@ -948,9 +935,6 @@ python_doheader() { |
99 |
debug-print-function ${FUNCNAME} "${@}" |
100 |
|
101 |
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' |
102 |
- if [[ ${EAPI:-0} == [0123] ]]; then |
103 |
- die "python_do* and python_new* helpers are banned in EAPIs older than 4." |
104 |
- fi |
105 |
|
106 |
local d PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR} |
107 |
[[ ${PYTHON_INCLUDEDIR} ]] || python_export PYTHON_INCLUDEDIR |
108 |
@@ -1093,10 +1077,7 @@ python_is_installed() { |
109 |
[[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON" |
110 |
local hasv_args=() |
111 |
|
112 |
- case ${EAPI:-0} in |
113 |
- 0|1|2|3|4) |
114 |
- local -x ROOT=/ |
115 |
- ;; |
116 |
+ case ${EAPI} in |
117 |
5|6) |
118 |
hasv_args+=( --host-root ) |
119 |
;; |
120 |
@@ -1265,7 +1246,7 @@ python_fix_shebang() { |
121 |
|
122 |
if [[ ! ${any_fixed} ]]; then |
123 |
local cmd=eerror |
124 |
- [[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn |
125 |
+ [[ ${EAPI} == 5 ]] && cmd=eqawarn |
126 |
|
127 |
"${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files." |
128 |
if [[ ${any_correct} ]]; then |