From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-python+bounces-488-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id D2FFE138200
	for <garchives@archives.gentoo.org>; Mon, 22 Jul 2013 09:51:20 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 82B3EE0A99;
	Mon, 22 Jul 2013 09:51:16 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 2570EE0A99
	for <gentoo-python@lists.gentoo.org>; Mon, 22 Jul 2013 09:51:16 +0000 (UTC)
Received: from pomiot.lan (213-238-102-188.adsl.inetia.pl [213.238.102.188])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: mgorny)
	by smtp.gentoo.org (Postfix) with ESMTPSA id 4AE2B33DEE1;
	Mon, 22 Jul 2013 09:51:14 +0000 (UTC)
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH 2/6] [python-any-r1] do not use has_version() for interpreter checks.
Date: Mon, 22 Jul 2013 11:51:15 +0200
Message-Id: <1374486679-15887-2-git-send-email-mgorny@gentoo.org>
X-Mailer: git-send-email 1.8.3.2
In-Reply-To: <20130722114917.4f8d4b9a@gentoo.org>
References: <20130722114917.4f8d4b9a@gentoo.org>
Precedence: bulk
List-Post: <mailto:gentoo-python@lists.gentoo.org>
List-Help: <mailto:gentoo-python+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-python+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-python+subscribe@lists.gentoo.org>
List-Id: Discussions centering around the Python ecosystem in Gentoo Linux <gentoo-python.gentoo.org>
X-BeenThere: gentoo-python@gentoo.org
X-BeenThere: gentoo-python@lists.gentoo.org
X-Archives-Salt: 33006445-03f2-4a65-93ce-9d4965082c92
X-Archives-Hash: f161d5171289d015dbe79b41ea203496

has_version() can't handle any-of deps, and I see no point in
introducing special magic to handle pypy-bin there. Instead, just check
if the interpreter executable is installed. It is simpler and faster
this way.
---
 gx86/eclass/python-any-r1.eclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gx86/eclass/python-any-r1.eclass b/gx86/eclass/python-any-r1.eclass
index aa11cf7..b392453 100644
--- a/gx86/eclass/python-any-r1.eclass
+++ b/gx86/eclass/python-any-r1.eclass
@@ -176,9 +176,10 @@ _python_EPYTHON_supported() {
 	esac
 
 	if has "${i}" "${PYTHON_COMPAT[@]}"; then
-		local PYTHON_PKG_DEP
-		python_export "${i}" PYTHON_PKG_DEP
-		if ROOT=/ has_version "${PYTHON_PKG_DEP}"; then
+		local PYTHON
+		python_export PYTHON
+
+		if [[ -x ${PYTHON} ]]; then
 			if declare -f python_check_deps >/dev/null; then
 				local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
 				python_check_deps
-- 
1.8.3.2