1 |
djc 11/07/04 11:28:25 |
2 |
|
3 |
Modified: python.eclass |
4 |
Log: |
5 |
Pass Python ABI patterns list to _python_check_python_abi_matching() to |
6 |
simplify some code. (Patch by Arfrever. Backported from python overlay.) |
7 |
|
8 |
Revision Changes Path |
9 |
1.117 eclass/python.eclass |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.eclass?rev=1.117&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.eclass?rev=1.117&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python.eclass?r1=1.116&r2=1.117 |
14 |
|
15 |
Index: python.eclass |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v |
18 |
retrieving revision 1.116 |
19 |
retrieving revision 1.117 |
20 |
diff -u -r1.116 -r1.117 |
21 |
--- python.eclass 4 Jul 2011 11:27:53 -0000 1.116 |
22 |
+++ python.eclass 4 Jul 2011 11:28:24 -0000 1.117 |
23 |
@@ -1,6 +1,6 @@ |
24 |
# Copyright 1999-2011 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.116 2011/07/04 11:27:53 djc Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.117 2011/07/04 11:28:24 djc Exp $ |
28 |
|
29 |
# @ECLASS: python.eclass |
30 |
# @MAINTAINER: |
31 |
@@ -708,9 +708,7 @@ |
32 |
_python_initial_sanity_checks |
33 |
|
34 |
if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3 4; then |
35 |
- local PYTHON_ABI restricted_ABI restricted_ABIs support_ABI supported_PYTHON_ABIS |
36 |
- |
37 |
- restricted_ABIs="${RESTRICT_PYTHON_ABIS// /$'\n'}" |
38 |
+ local PYTHON_ABI |
39 |
|
40 |
if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then |
41 |
local cpython_enabled="0" |
42 |
@@ -728,14 +726,9 @@ |
43 |
cpython_enabled="1" |
44 |
fi |
45 |
|
46 |
- support_ABI="1" |
47 |
- while read restricted_ABI; do |
48 |
- if _python_check_python_abi_matching "${PYTHON_ABI}" "${restricted_ABI}"; then |
49 |
- support_ABI="0" |
50 |
- break |
51 |
- fi |
52 |
- done <<< "${restricted_ABIs}" |
53 |
- [[ "${support_ABI}" == "1" ]] && export PYTHON_ABIS+="${PYTHON_ABIS:+ }${PYTHON_ABI}" |
54 |
+ if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then |
55 |
+ export PYTHON_ABIS+="${PYTHON_ABIS:+ }${PYTHON_ABI}" |
56 |
+ fi |
57 |
done |
58 |
|
59 |
if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then |
60 |
@@ -761,21 +754,17 @@ |
61 |
|
62 |
python2_version="$("${EPREFIX}/usr/bin/python2" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')" |
63 |
|
64 |
+ support_python_major_version="0" |
65 |
for PYTHON_ABI in "${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]}"; do |
66 |
- support_python_major_version="1" |
67 |
- while read restricted_ABI; do |
68 |
- if _python_check_python_abi_matching "${PYTHON_ABI}" "${restricted_ABI}"; then |
69 |
- support_python_major_version="0" |
70 |
- fi |
71 |
- done <<< "${restricted_ABIs}" |
72 |
- [[ "${support_python_major_version}" == "1" ]] && break |
73 |
+ if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then |
74 |
+ support_python_major_version="1" |
75 |
+ break |
76 |
+ fi |
77 |
done |
78 |
if [[ "${support_python_major_version}" == "1" ]]; then |
79 |
- while read restricted_ABI; do |
80 |
- if _python_check_python_abi_matching "${python2_version}" "${restricted_ABI}"; then |
81 |
- die "Active version of CPython 2 is not supported by ${CATEGORY}/${PF}" |
82 |
- fi |
83 |
- done <<< "${restricted_ABIs}" |
84 |
+ if _python_check_python_abi_matching --patterns-list "${python2_version}" "${RESTRICT_PYTHON_ABIS}"; then |
85 |
+ die "Active version of CPython 2 is not supported by ${CATEGORY}/${PF}" |
86 |
+ fi |
87 |
else |
88 |
python2_version="" |
89 |
fi |
90 |
@@ -788,21 +777,17 @@ |
91 |
|
92 |
python3_version="$("${EPREFIX}/usr/bin/python3" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')" |
93 |
|
94 |
+ support_python_major_version="0" |
95 |
for PYTHON_ABI in "${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]}"; do |
96 |
- support_python_major_version="1" |
97 |
- while read restricted_ABI; do |
98 |
- if _python_check_python_abi_matching "${PYTHON_ABI}" "${restricted_ABI}"; then |
99 |
- support_python_major_version="0" |
100 |
- fi |
101 |
- done <<< "${restricted_ABIs}" |
102 |
- [[ "${support_python_major_version}" == "1" ]] && break |
103 |
+ if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then |
104 |
+ support_python_major_version="1" |
105 |
+ break |
106 |
+ fi |
107 |
done |
108 |
if [[ "${support_python_major_version}" == "1" ]]; then |
109 |
- while read restricted_ABI; do |
110 |
- if _python_check_python_abi_matching "${python3_version}" "${restricted_ABI}"; then |
111 |
- die "Active version of CPython 3 is not supported by ${CATEGORY}/${PF}" |
112 |
- fi |
113 |
- done <<< "${restricted_ABIs}" |
114 |
+ if _python_check_python_abi_matching --patterns-list "${python3_version}" "${RESTRICT_PYTHON_ABIS}"; then |
115 |
+ die "Active version of CPython 3 is not supported by ${CATEGORY}/${PF}" |
116 |
+ fi |
117 |
else |
118 |
python3_version="" |
119 |
fi |