Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH python-utils-r1 2/4] Use python_is_python3 in the eclass.
Date: Wed, 21 Aug 2013 19:54:57
Message-Id: 1377114866-2669-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-python] [PATCHES] Initial python-utils-r1 changes for PyPy 2.1 by "Michał Górny"
1 ---
2 gx86/eclass/python-utils-r1.eclass | 8 ++++----
3 1 file changed, 4 insertions(+), 4 deletions(-)
4
5 diff --git a/gx86/eclass/python-utils-r1.eclass b/gx86/eclass/python-utils-r1.eclass
6 index 00399d2..e798c8d 100644
7 --- a/gx86/eclass/python-utils-r1.eclass
8 +++ b/gx86/eclass/python-utils-r1.eclass
9 @@ -532,8 +532,8 @@ _python_rewrite_shebang() {
10 die "${FUNCNAME}: ${f} does not seem to have a valid shebang"
11 fi
12
13 - if [[ ${from} == python2 && ${impl} == python3*
14 - || ${from} == python3 && ${impl} != python3* ]]; then
15 + if [[ ${from} == python2 ]] && python_is_python3 "${impl}" \
16 + || [[ ${from} == python3 ]] && ! python_is_python3 "${impl}"; then
17 eerror "A file does have shebang not supporting requested impl:"
18 eerror " file: ${f}"
19 eerror " shebang: ${shebang}"
20 @@ -883,9 +883,9 @@ python_wrapper_setup() {
21 python_export "${impl}" EPYTHON PYTHON
22
23 local pyver
24 - if [[ ${EPYTHON} == python3* ]]; then
25 + if python_is_python3; then
26 pyver=3
27 - else # includes pypy & jython
28 + else
29 pyver=2
30 fi
31
32 --
33 1.8.3.2