From 0ec3738a167f4cc4ed91987dee3d74bc05b9f344 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 20 Dec 2012 23:35:17 +0000 Subject: Commonize the code for obtaining the Python interpreter dependency string. --- eclass/python-any-r1.eclass | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'eclass/python-any-r1.eclass') diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index ad56dc7520e2..734d3dbae799 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python-any-r1.eclass,v 1.2 2012/12/07 18:00:08 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python-any-r1.eclass,v 1.3 2012/12/20 23:35:17 mgorny Exp $ # @ECLASS: python-any-r1 # @MAINTAINER: @@ -202,25 +202,13 @@ python-any-r1_pkg_setup() { fi done + local PYTHON_PKG_DEP for i in "${rev_impls[@]}"; do - local d - case "${i}" in - python*) - d='dev-lang/python';; - jython*) - d='dev-java/jython';; - pypy*) - d='dev-python/pypy';; - *) - die "Invalid implementation: ${i}" - esac - local v=${i##*[a-z]} - - if has_version "${d}:${v/_/.}${usestr}"; then - python_export "${i}" EPYTHON PYTHON - break - fi + python_export "${i}" PYTHON_PKG_DEP EPYTHON PYTHON + has_version "${PYTHON_PKG_DEP}" && break done + + die $EPYTHON } _PYTHON_ANY_R1=1 -- cgit v1.2.3-65-gdbad