From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-python+bounces-443-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 58A0C1381F3
	for <garchives@archives.gentoo.org>; Mon, 22 Apr 2013 10:51:44 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 06040E0B13;
	Mon, 22 Apr 2013 10:51:42 +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 9A478E0B13
	for <gentoo-python@lists.gentoo.org>; Mon, 22 Apr 2013 10:51:41 +0000 (UTC)
Received: from pomiocik.localdomain (s241.wifi.put.poznan.pl [150.254.132.242])
	(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 A244A33DB6E;
	Mon, 22 Apr 2013 10:51:39 +0000 (UTC)
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org,
	=?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH 1/4] Make Python checks consistent.
Date: Mon, 22 Apr 2013 12:52:55 +0200
Message-Id: <1366627978-8571-1-git-send-email-mgorny@gentoo.org>
X-Mailer: git-send-email 1.8.1.5
In-Reply-To: <20130422125150.5a2396e6@pomiocik>
References: <20130422125150.5a2396e6@pomiocik>
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: 7845d43e-a113-4365-ba5d-16b0d93b46b0
X-Archives-Hash: dae46be188c184ab220e73679b87ad9e

Always use _python_EPYTHON_supported(), and always check for the package
being installed.
---
 gx86/eclass/python-any-r1.eclass | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gx86/eclass/python-any-r1.eclass b/gx86/eclass/python-any-r1.eclass
index dc3443b..3799491 100644
--- a/gx86/eclass/python-any-r1.eclass
+++ b/gx86/eclass/python-any-r1.eclass
@@ -158,7 +158,11 @@ _python_EPYTHON_supported() {
 	esac
 
 	if has "${i}" "${PYTHON_COMPAT[@]}"; then
-		return 0
+		local PYTHON_PKG_DEP
+		python_export "${i}" PYTHON_PKG_DEP
+		if ROOT=/ has_version "${PYTHON_PKG_DEP}"; then
+			return 0
+		fi
 	elif ! has "${i}" "${_PYTHON_ALL_IMPLS[@]}"; then
 		ewarn "Invalid EPYTHON: ${EPYTHON}"
 	fi
@@ -202,10 +206,9 @@ python-any-r1_pkg_setup() {
 		fi
 	done
 
-	local PYTHON_PKG_DEP
 	for i in "${rev_impls[@]}"; do
-		python_export "${i}" PYTHON_PKG_DEP EPYTHON PYTHON
-		if ROOT=/ has_version "${PYTHON_PKG_DEP}"; then
+		python_export "${i}" EPYTHON PYTHON
+		if _python_EPYTHON_supported "${EPYTHON}"; then
 			python_wrapper_setup "${T}"
 			return
 		fi
-- 
1.8.1.5