From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1133E198005 for ; Wed, 27 Feb 2013 21:45:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B713FE0B08; Wed, 27 Feb 2013 21:43: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 D39E4E0AF3 for ; Wed, 27 Feb 2013 21:43:15 +0000 (UTC) Received: from pomiocik.lan (77-253-193-205.adsl.inetia.pl [77.253.193.205]) (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 B40F333DF5B; Wed, 27 Feb 2013 21:43:12 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 5/8] python-r1: calculate final list of enabled impls for foreach. Date: Wed, 27 Feb 2013 22:43:22 +0100 Message-Id: <1362001405-25636-5-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <20130227224152.6d1293c9@pomiocik.lan> References: <20130227224152.6d1293c9@pomiocik.lan> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: b4b2b686-2644-43ee-a1be-e42df0a0ad98 X-Archives-Hash: f2789ba640dbedb1f4f4e40261ec5d5c --- gx86/eclass/python-r1.eclass | 61 +++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass index 310859e..a1d9228 100644 --- a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass @@ -586,6 +586,22 @@ _python_check_USE_PYTHON() { fi } +# @FUNCTION: _python_obtain_impls +# @INTERNAL +# @DESCRIPTION: +# Set up the enabled implementation list. +_python_obtain_impls() { + MULTIBUILD_VARIANTS=() + + for impl in "${_PYTHON_ALL_IMPLS[@]}"; do + if has "${impl}" "${PYTHON_COMPAT[@]}" \ + && use "python_targets_${impl}" + then + MULTIBUILD_VARIANTS+=( "${impl}" ) + fi + done +} + # @FUNCTION: python_foreach_impl # @USAGE: [...] # @DESCRIPTION: @@ -608,33 +624,30 @@ python_foreach_impl() { local impl local bdir=${BUILD_DIR:-${S}} local ret=0 lret=0 + local MULTIBUILD_VARIANTS debug-print "${FUNCNAME}: bdir = ${bdir}" - for impl in "${_PYTHON_ALL_IMPLS[@]}"; do - if has "${impl}" "${PYTHON_COMPAT[@]}" \ - && _python_impl_supported "${impl}" \ - && use "python_targets_${impl}" - then - local EPYTHON PYTHON - python_export "${impl}" EPYTHON PYTHON - local BUILD_DIR=${bdir%%/}-${impl} - export EPYTHON PYTHON - - einfo "${EPYTHON}: running ${@}" \ - | tee -a "${T}/build-${EPYTHON}.log" - - # _python_parallel() does redirection internally. - # note: this is a hidden API to avoid writing python_foreach_impl - # twice. do *not* even think of using it anywhere else. - if [[ ${1} == _python_parallel ]]; then - "${@}" - else - "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log" - fi - lret=${?} - - [[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret} + _python_obtain_impls + for impl in "${MULTIBUILD_VARIANTS[@]}"; do + local EPYTHON PYTHON + python_export "${impl}" EPYTHON PYTHON + local BUILD_DIR=${bdir%%/}-${impl} + export EPYTHON PYTHON + + einfo "${EPYTHON}: running ${@}" \ + | tee -a "${T}/build-${EPYTHON}.log" + + # _python_parallel() does redirection internally. + # note: this is a hidden API to avoid writing python_foreach_impl + # twice. do *not* even think of using it anywhere else. + if [[ ${1} == _python_parallel ]]; then + "${@}" + else + "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log" fi + lret=${?} + + [[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret} done return ${ret} -- 1.8.1.4