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 4763C198005 for ; Sun, 10 Mar 2013 10:19:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4983AE076B; Sun, 10 Mar 2013 10:17:51 +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 503D0E0752 for ; Sun, 10 Mar 2013 10:17:45 +0000 (UTC) Received: from pomiocik.lan (77-255-9-250.adsl.inetia.pl [77.255.9.250]) (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 ACE6433C1EE; Sun, 10 Mar 2013 10:17:42 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: hasufell@gentoo.org, python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 2/7] distutils-r1: use multibuild phase helpers. Date: Sun, 10 Mar 2013 11:18:06 +0100 Message-Id: <1362910691-8439-2-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <20130310111644.0840d935@pomiocik.lan> References: <20130310111644.0840d935@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: 24f2323c-0f58-40ba-9b21-f3b79905f6cc X-Archives-Hash: 94874c73ffcae138ee07270992b0fb41 --- gx86/eclass/distutils-r1.eclass | 71 ++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 44 deletions(-) diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass index 264ce9c..ce518a7 100644 --- a/gx86/eclass/distutils-r1.eclass +++ b/gx86/eclass/distutils-r1.eclass @@ -92,6 +92,8 @@ fi if [[ ! ${DISTUTILS_OPTIONAL} ]]; then EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install fi +multibuild_export_phases \ + python_prepare_all python_compile python_install python_install_all if [[ ! ${_DISTUTILS_R1} ]]; then @@ -559,6 +561,9 @@ distutils-r1_run_phase() { # If in-source build is used, the command will be run in the copy # of sources made for the best Python interpreter. _distutils-r1_run_common_phase() { + # not all phases need be set + [[ ${1} ]] || return + local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR} local MULTIBUILD_VARIANTS @@ -576,6 +581,9 @@ _distutils-r1_run_common_phase() { _distutils-r1_run_foreach_impl() { debug-print-function ${FUNCNAME} "${@}" + # not all phases need be set + [[ ${1} ]] || return + set -- distutils-r1_run_phase "${@}" if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then @@ -599,68 +607,43 @@ _distutils-r1_run_foreach_impl() { distutils-r1_src_prepare() { debug-print-function ${FUNCNAME} "${@}" - # common preparations - if declare -f python_prepare_all >/dev/null; then - python_prepare_all - else - distutils-r1_python_prepare_all - fi - - if declare -f python_prepare >/dev/null; then - _distutils-r1_run_foreach_impl python_prepare - fi + "$(multibuild_get_phase_function python_prepare_all)" + _distutils-r1_run_foreach_impl \ + "$(multibuild_get_phase_function python_prepare)" } distutils-r1_src_configure() { - if declare -f python_configure >/dev/null; then - _distutils-r1_run_foreach_impl python_configure - fi - - if declare -f python_configure_all >/dev/null; then - _distutils-r1_run_common_phase python_configure_all - fi + _distutils-r1_run_foreach_impl \ + "$(multibuild_get_phase_function python_configure)" + _distutils-r1_run_common_phase \ + "$(multibuild_get_phase_function python_configure_all)" } distutils-r1_src_compile() { debug-print-function ${FUNCNAME} "${@}" - if declare -f python_compile >/dev/null; then - _distutils-r1_run_foreach_impl python_compile - else - _distutils-r1_run_foreach_impl distutils-r1_python_compile - fi - - if declare -f python_compile_all >/dev/null; then - _distutils-r1_run_common_phase python_compile_all - fi + _distutils-r1_run_foreach_impl \ + "$(multibuild_get_phase_function python_compile)" + _distutils-r1_run_common_phase \ + "$(multibuild_get_phase_function python_compile_all)" } distutils-r1_src_test() { debug-print-function ${FUNCNAME} "${@}" - if declare -f python_test >/dev/null; then - _distutils-r1_run_foreach_impl python_test - fi - - if declare -f python_test_all >/dev/null; then - _distutils-r1_run_common_phase python_test_all - fi + _distutils-r1_run_foreach_impl \ + "$(multibuild_get_phase_function python_test)" + _distutils-r1_run_common_phase \ + "$(multibuild_get_phase_function python_test_all)" } distutils-r1_src_install() { debug-print-function ${FUNCNAME} "${@}" - if declare -f python_install >/dev/null; then - _distutils-r1_run_foreach_impl python_install - else - _distutils-r1_run_foreach_impl distutils-r1_python_install - fi - - if declare -f python_install_all >/dev/null; then - _distutils-r1_run_common_phase python_install_all - else - _distutils-r1_run_common_phase distutils-r1_python_install_all - fi + _distutils-r1_run_foreach_impl \ + "$(multibuild_get_phase_function python_install)" + _distutils-r1_run_common_phase \ + "$(multibuild_get_phase_function python_install_all)" } _DISTUTILS_R1=1 -- 1.8.1.5