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 F239A198005 for ; Wed, 27 Feb 2013 21:46:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5E865E0B27; Wed, 27 Feb 2013 21:43:18 +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 64013E0B16 for ; Wed, 27 Feb 2013 21:43:17 +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 8C9A033DEDD; Wed, 27 Feb 2013 21:43:15 +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 6/8] Convert python-r1 to use multibuild. Date: Wed, 27 Feb 2013 22:43:23 +0100 Message-Id: <1362001405-25636-6-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: 00c472ce-148b-4ff9-b173-9b3562eb9e61 X-Archives-Hash: 30a4ecf05484969e271eb0c5930d99ad --- gx86/eclass/python-r1.eclass | 74 +++++++++++++------------------------------- 1 file changed, 21 insertions(+), 53 deletions(-) diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass index a1d9228..fb9032e 100644 --- a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass @@ -48,7 +48,7 @@ elif [[ ${_PYTHON_ANY_R1} ]]; then die 'python-r1.eclass can not be used with python-any-r1.eclass.' fi -inherit python-utils-r1 +inherit multibuild python-utils-r1 # @ECLASS-VARIABLE: PYTHON_COMPAT # @REQUIRED @@ -602,6 +602,21 @@ _python_obtain_impls() { done } +# @FUNCTION: _python_multibuild_wrapper +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Initialize the environment for Python implementation selected +# for multibuild. +_python_multibuild_wrapper() { + debug-print-function ${FUNCNAME} "${@}" + + local -x EPYTHON PYTHON + python_export "${MULTIBUILD_VARIANT}" EPYTHON PYTHON + + "${@}" +} + # @FUNCTION: python_foreach_impl # @USAGE: [...] # @DESCRIPTION: @@ -621,36 +636,10 @@ python_foreach_impl() { _python_validate_useflags _python_check_USE_PYTHON - local impl - local bdir=${BUILD_DIR:-${S}} - local ret=0 lret=0 local MULTIBUILD_VARIANTS - - debug-print "${FUNCNAME}: bdir = ${bdir}" _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} + multibuild_foreach _python_multibuild_wrapper "${@}" } # @FUNCTION: python_parallel_foreach_impl @@ -672,32 +661,11 @@ python_foreach_impl() { python_parallel_foreach_impl() { debug-print-function ${FUNCNAME} "${@}" - local ret lret - - _python_parallel() { - ( - multijob_child_init - "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log" - exit ${PIPESTATUS[0]} - ) & - multijob_post_fork - } - - local opts - if [[ ${DISTUTILS_JOBS} ]]; then - opts=-j${DISTUTILS_JOBS} - else - opts=${MAKEOPTS} - fi - - multijob_init "${opts}" - python_foreach_impl _python_parallel "${@}" - ret=${?} - multijob_finish - lret=${?} + local MULTIBUILD_JOBS=${MULTIBUILD_JOBS:-${DISTUTILS_JOBS}} + local MULTIBUILD_VARIANTS + _python_obtain_impls - [[ ${ret} -eq 0 ]] && ret=${lret} - return ${ret} + multibuild_parallel_foreach _python_multibuild_wrapper "${@}" } # @FUNCTION: python_export_best -- 1.8.1.4