Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH 6/6] [python.eclass] Support pypy-bin in python_get_implement...
Date: Mon, 22 Jul 2013 09:51:22
Message-Id: 1374486679-15887-6-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-python] [PATCH] Eclass support for pypy-bin by "Michał Górny"
1 The python_get_implementational_package() is used solely in the eclass
2 for integrity checks, and is always passed to 'has_version'. Therefore,
3 it should be enough to put a has_version hack in it, and output either
4 dev-python/pypy-bin or dev-python/pypy depending on which of them is
5 installed.
6
7 This eclass is no longer maintained and it seems not to output any
8 dependencies on pypy packages.
9 ---
10 gx86/eclass/python.eclass | 12 ++++++++++--
11 1 file changed, 10 insertions(+), 2 deletions(-)
12
13 diff --git a/gx86/eclass/python.eclass b/gx86/eclass/python.eclass
14 index 3f94e0b..272808b 100644
15 --- a/gx86/eclass/python.eclass
16 +++ b/gx86/eclass/python.eclass
17 @@ -2054,7 +2054,11 @@ python_get_implementational_package() {
18 elif [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "Jython" ]]; then
19 echo "=dev-java/jython-${PYTHON_ABI%-jython}*"
20 elif [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "PyPy" ]]; then
21 - echo "=dev-python/pypy-${PYTHON_ABI#*-pypy-}*"
22 + if has_version "=dev-python/pypy-bin-${PYTHON_ABI#*-pypy-}*"; then
23 + echo "=dev-python/pypy-bin-${PYTHON_ABI#*-pypy-}*"
24 + else
25 + echo "=dev-python/pypy-${PYTHON_ABI#*-pypy-}*"
26 + fi
27 fi
28 else
29 if [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "CPython" ]]; then
30 @@ -2062,7 +2066,11 @@ python_get_implementational_package() {
31 elif [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "Jython" ]]; then
32 echo "dev-java/jython:${PYTHON_ABI%-jython}"
33 elif [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "PyPy" ]]; then
34 - echo "dev-python/pypy:${PYTHON_ABI#*-pypy-}"
35 + if has_version "dev-python/pypy-bin:${PYTHON_ABI#*-pypy-}"; then
36 + echo "dev-python/pypy-bin:${PYTHON_ABI#*-pypy-}"
37 + else
38 + echo "dev-python/pypy:${PYTHON_ABI#*-pypy-}"
39 + fi
40 fi
41 fi
42 }
43 --
44 1.8.3.2