1 |
arfrever 09/10/02 17:32:23 |
2 |
|
3 |
Modified: python.eclass |
4 |
Log: |
5 |
Print a warning when Python 2 or Python 3 is explicitly disabled. |
6 |
|
7 |
Revision Changes Path |
8 |
1.75 eclass/python.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?rev=1.75&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?rev=1.75&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.eclass?r1=1.74&r2=1.75 |
13 |
|
14 |
Index: python.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v |
17 |
retrieving revision 1.74 |
18 |
retrieving revision 1.75 |
19 |
diff -u -r1.74 -r1.75 |
20 |
--- python.eclass 2 Oct 2009 02:02:24 -0000 1.74 |
21 |
+++ python.eclass 2 Oct 2009 17:32:23 -0000 1.75 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2009 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.74 2009/10/02 02:02:24 arfrever Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.75 2009/10/02 17:32:23 arfrever Exp $ |
27 |
|
28 |
# @ECLASS: python.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -127,10 +127,14 @@ |
31 |
|
32 |
# USE_${ABI_TYPE^^} and RESTRICT_${ABI_TYPE^^}_ABIS variables hopefully will be included in EAPI >= 4. |
33 |
if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3; then |
34 |
- local ABI restricted_ABI support_ABI supported_PYTHON_ABIS= |
35 |
+ local ABI python2_supported_versions python3_supported_versions restricted_ABI support_ABI supported_PYTHON_ABIS= |
36 |
PYTHON_ABI_SUPPORTED_VALUES="2.4 2.5 2.6 2.7 3.0 3.1 3.2" |
37 |
+ python2_supported_versions="2.4 2.5 2.6 2.7" |
38 |
+ python3_supported_versions="3.0 3.1 3.2" |
39 |
|
40 |
if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then |
41 |
+ local python2_enabled="0" python3_enabled="0" |
42 |
+ |
43 |
if [[ -z "${USE_PYTHON}" ]]; then |
44 |
die "USE_PYTHON variable is empty" |
45 |
fi |
46 |
@@ -139,6 +143,14 @@ |
47 |
if ! has "${ABI}" ${PYTHON_ABI_SUPPORTED_VALUES}; then |
48 |
die "USE_PYTHON variable contains invalid value '${ABI}'" |
49 |
fi |
50 |
+ |
51 |
+ if has "${ABI}" ${python2_supported_versions}; then |
52 |
+ python2_enabled="1" |
53 |
+ fi |
54 |
+ if has "${ABI}" ${python3_supported_versions}; then |
55 |
+ python3_enabled="1" |
56 |
+ fi |
57 |
+ |
58 |
support_ABI="1" |
59 |
for restricted_ABI in ${RESTRICT_PYTHON_ABIS}; do |
60 |
if python -c "from fnmatch import fnmatch; exit(not fnmatch('${ABI}', '${restricted_ABI}'))"; then |
61 |
@@ -153,8 +165,15 @@ |
62 |
if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then |
63 |
die "USE_PYTHON variable doesn't enable any version of Python supported by ${CATEGORY}/${PF}" |
64 |
fi |
65 |
+ |
66 |
+ if [[ "${python2_enabled}" == "0" ]]; then |
67 |
+ ewarn "USE_PYTHON variable doesn't enable any version of Python 2. This configuration is unsupported." |
68 |
+ fi |
69 |
+ if [[ "${python3_enabled}" == "0" ]]; then |
70 |
+ ewarn "USE_PYTHON variable doesn't enable any version of Python 3. This configuration is unsupported." |
71 |
+ fi |
72 |
else |
73 |
- local ABI python2_version= python2_supported_versions python3_version= python3_supported_versions restricted_ABI support_python_major_version |
74 |
+ local python2_version= python3_version= support_python_major_version |
75 |
|
76 |
if has_version "=dev-lang/python-2*"; then |
77 |
if [[ "$(readlink /usr/bin/python2)" != "python2."* ]]; then |
78 |
@@ -162,7 +181,6 @@ |
79 |
fi |
80 |
|
81 |
python2_version="$(/usr/bin/python2 -c 'from sys import version_info; print(".".join([str(x) for x in version_info[:2]]))')" |
82 |
- python2_supported_versions="2.4 2.5 2.6 2.7" |
83 |
|
84 |
for ABI in ${python2_supported_versions}; do |
85 |
support_python_major_version="1" |
86 |
@@ -190,7 +208,6 @@ |
87 |
fi |
88 |
|
89 |
python3_version="$(/usr/bin/python3 -c 'from sys import version_info; print(".".join([str(x) for x in version_info[:2]]))')" |
90 |
- python3_supported_versions="3.0 3.1 3.2" |
91 |
|
92 |
for ABI in ${python3_supported_versions}; do |
93 |
support_python_major_version="1" |