public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: Mike Gilbert <floppym@gentoo.org>
Cc: gentoo-python@lists.gentoo.org, python@gentoo.org
Subject: Re: [gentoo-python] Re: [PATCH updated 1/3] Set env for best Python impl in *_all() phases.
Date: Mon, 3 Dec 2012 19:52:03 +0100	[thread overview]
Message-ID: <20121203195203.73fc045a@pomiocik.lan> (raw)
In-Reply-To: <50BCC962.4080100@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 3387 bytes --]

On Mon, 03 Dec 2012 10:46:42 -0500
Mike Gilbert <floppym@gentoo.org> wrote:

> On 12/3/2012 6:00 AM, Michał Górny 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(-)
> > 
> > diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
> > 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=(
> > +		"${EPYTHON}" "${PYTHON}" "${BUILD_DIR}" "${PYTHONPATH}"
> > +	)
> 
> Why are you using an array here? To save 1 line of code?

Yes, something like that. Plus do not have to invent names for all
of them.

> Putting the values in an array makes them anonymous for no reason I can see.

To be honest, I don't see a reason for them to be non-anonymous. It's
not something user should touch. A bit like four variables == four
times as much risk of random collision.

> > +}
> > +
> > +# @FUNCTION: _distutils-r1_run_common_phase
> > +# @USAGE: [<argv>...]
> > +# @INTERNAL
> > +# @DESCRIPTION:
> > +# Run the given command, restoring the best-implementation state.
> > +_distutils-r1_run_common_phase() {
> > +	local EPYTHON=${_DISTUTILS_BEST_IMPL[0]}
> > +	local PYTHON=${_DISTUTILS_BEST_IMPL[1]}
> > +	local BEST_BUILD_DIR=${_DISTUTILS_BEST_IMPL[2]}
> > +	local PYTHONPATH=${_DISTUTILS_BEST_IMPL[3]}
> > +
> > +	export EPYTHON PYTHON PYTHONPATH
> > +
> > +	"${@}"
> >  }
> >  
> >  distutils-r1_src_prepare() {
> > @@ -419,7 +440,7 @@ distutils-r1_src_configure() {
> >  	multijob_finish
> >  
> >  	if declare -f python_configure_all >/dev/null; then
> > -		python_configure_all
> > +		_distutils-r1_run_common_phase python_configure_all
> >  	fi
> >  }
> >  
> > @@ -435,7 +456,7 @@ distutils-r1_src_compile() {
> >  	multijob_finish
> >  
> >  	if declare -f python_compile_all >/dev/null; then
> > -		python_compile_all
> > +		_distutils-r1_run_common_phase python_compile_all
> >  	fi
> >  }
> >  
> > @@ -451,7 +472,7 @@ distutils-r1_src_test() {
> >  	multijob_finish
> >  
> >  	if declare -f python_test_all >/dev/null; then
> > -		python_test_all
> > +		_distutils-r1_run_common_phase python_test_all
> >  	fi
> >  }
> >  
> > @@ -467,9 +488,9 @@ distutils-r1_src_install() {
> >  	multijob_finish
> >  
> >  	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
> >  }
> >  
> 
> 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.

Well, the common case I can think of is building docs. Although it
isn't really necessary to bind that strongly to any specific
implementation, doing so allows packages to use compiled modules.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

      reply	other threads:[~2012-12-03 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03 11:00 [gentoo-python] [PATCH updated 1/3] Set env for best Python impl in *_all() phases Michał Górny
2012-12-03 11:00 ` [gentoo-python] [PATCH updated 2/3] Don't rely on phase function return code Michał Górny
2012-12-03 11:00 ` [gentoo-python] [PATCH updated 3/3] Example benefit of those changes Michał Górny
2012-12-03 15:46 ` [gentoo-python] Re: [PATCH updated 1/3] Set env for best Python impl in *_all() phases Mike Gilbert
2012-12-03 18:52   ` Michał Górny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121203195203.73fc045a@pomiocik.lan \
    --to=mgorny@gentoo.org \
    --cc=floppym@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=python@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox