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 C42E91381F3 for ; Mon, 3 Dec 2012 15:46:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A5914E05F1; Mon, 3 Dec 2012 15:46:52 +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 03319E05F1 for ; Mon, 3 Dec 2012 15:46:51 +0000 (UTC) Received: from [10.171.88.37] (107-1-212-138-ip-static.hfc.comcastbusiness.net [107.1.212.138]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id C379633D9C1; Mon, 3 Dec 2012 15:46:50 +0000 (UTC) Message-ID: <50BCC962.4080100@gentoo.org> Date: Mon, 03 Dec 2012 10:46:42 -0500 From: Mike Gilbert User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org MIME-Version: 1.0 To: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= CC: gentoo-python@lists.gentoo.org, python@gentoo.org Subject: [gentoo-python] Re: [PATCH updated 1/3] Set env for best Python impl in *_all() phases. References: <1354532406-5591-1-git-send-email-mgorny@gentoo.org> In-Reply-To: <1354532406-5591-1-git-send-email-mgorny@gentoo.org> X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig99D2D769BFC706F8036EF4BF" X-Archives-Salt: afbd9ef5-3ee5-4474-beff-abb5fc89914c X-Archives-Hash: 33b848314a917789f055a3ab98376442 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig99D2D769BFC706F8036EF4BF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/3/2012 6:00 AM, Micha=C5=82 G=C3=B3rny wrote: > Export the best implementation's build dir as BEST_BUILD_DIR, in order > to avoid clobbering original BUILD_DIR. > --- > gx86/eclass/distutils-r1.eclass | 31 ++++++++++++++++++++++++++----- > 1 file changed, 26 insertions(+), 5 deletions(-) >=20 > diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1= =2Eeclass > index b1b3f90..db8fe86 100644 > --- a/gx86/eclass/distutils-r1.eclass > +++ b/gx86/eclass/distutils-r1.eclass > @@ -388,6 +388,27 @@ distutils-r1_run_phase() { > if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then > popd &>/dev/null || die > fi > + > + # Store them for reuse. > + _DISTUTILS_BEST_IMPL=3D( > + "${EPYTHON}" "${PYTHON}" "${BUILD_DIR}" "${PYTHONPATH}" > + ) Why are you using an array here? To save 1 line of code? Putting the values in an array makes them anonymous for no reason I can s= ee. > +} > + > +# @FUNCTION: _distutils-r1_run_common_phase > +# @USAGE: [...] > +# @INTERNAL > +# @DESCRIPTION: > +# Run the given command, restoring the best-implementation state. > +_distutils-r1_run_common_phase() { > + local EPYTHON=3D${_DISTUTILS_BEST_IMPL[0]} > + local PYTHON=3D${_DISTUTILS_BEST_IMPL[1]} > + local BEST_BUILD_DIR=3D${_DISTUTILS_BEST_IMPL[2]} > + local PYTHONPATH=3D${_DISTUTILS_BEST_IMPL[3]} > + > + export EPYTHON PYTHON PYTHONPATH > + > + "${@}" > } > =20 > distutils-r1_src_prepare() { > @@ -419,7 +440,7 @@ distutils-r1_src_configure() { > multijob_finish > =20 > if declare -f python_configure_all >/dev/null; then > - python_configure_all > + _distutils-r1_run_common_phase python_configure_all > fi > } > =20 > @@ -435,7 +456,7 @@ distutils-r1_src_compile() { > multijob_finish > =20 > if declare -f python_compile_all >/dev/null; then > - python_compile_all > + _distutils-r1_run_common_phase python_compile_all > fi > } > =20 > @@ -451,7 +472,7 @@ distutils-r1_src_test() { > multijob_finish > =20 > if declare -f python_test_all >/dev/null; then > - python_test_all > + _distutils-r1_run_common_phase python_test_all > fi > } > =20 > @@ -467,9 +488,9 @@ distutils-r1_src_install() { > multijob_finish > =20 > if declare -f python_install_all >/dev/null; then > - python_install_all > + _distutils-r1_run_common_phase python_install_all > else > - distutils-r1_python_install_all > + _distutils-r1_run_common_phase distutils-r1_python_install_all > fi > } > =20 I haven't run into a situation that patch series is intended to address, so I don't have any strong opinion on it. If you think it is useful, fine by me. --------------enig99D2D769BFC706F8036EF4BF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) iF4EAREIAAYFAlC8yWgACgkQC77qH+pIQ6QC6gD/Qbwa6hwi9j8gCd8UsF+NJAG6 Q/a2VZoTJcbQ4mzaQcIA/0nRS9IuWjmTdjF2m312pxkz9kgInTRpRVpw5Z4vSlky =m1aJ -----END PGP SIGNATURE----- --------------enig99D2D769BFC706F8036EF4BF--