Gentoo Archives: gentoo-python

From: Mike Gilbert <floppym@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-python@l.g.o, python@g.o
Subject: [gentoo-python] Re: [PATCH python-r1 1/2] Reuse multibuild.eclass in python_export_best().
Date: Sun, 17 Mar 2013 23:36:34
Message-Id: CAJ0EP43Qp42SQ5RLbM0hwoyzkDstiyzYwc5sd4cPmuN-kAv2hQ@mail.gmail.com
In Reply to: [gentoo-python] [PATCH python-r1 1/2] Reuse multibuild.eclass in python_export_best(). by "Michał Górny"
1 On Sun, Mar 17, 2013 at 6:33 PM, Michał Górny <mgorny@g.o> wrote:
2 > ---
3 > gx86/eclass/python-r1.eclass | 22 ++++++++--------------
4 > 1 file changed, 8 insertions(+), 14 deletions(-)
5 >
6 > diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
7 > index 12e3baa..99bd240 100644
8 > --- a/gx86/eclass/python-r1.eclass
9 > +++ b/gx86/eclass/python-r1.eclass
10 > @@ -661,24 +661,18 @@ python_parallel_foreach_impl() {
11 > python_export_best() {
12 > debug-print-function ${FUNCNAME} "${@}"
13 >
14 > - _python_validate_useflags
15 > -
16 > [[ ${#} -gt 0 ]] || set -- EPYTHON PYTHON
17 >
18 > - local impl best
19 > - for impl in "${_PYTHON_ALL_IMPLS[@]}"; do
20 > - if has "${impl}" "${PYTHON_COMPAT[@]}" \
21 > - && _python_impl_supported "${impl}" \
22 > - && use "python_targets_${impl}"
23 > - then
24 > - best=${impl}
25 > - fi
26 > - done
27 > + local best MULTIBUILD_VARIANTS
28 > + _python_obtain_impls
29 >
30 > - [[ ${best+1} ]] || die "python_export_best(): no implementation found!"
31 > + _python_set_best() {
32 > + best=${MULTIBUILD_VARIANT}
33 > + }
34 > + multibuild_for_best_variant _python_set_best
35 >
36 > - debug-print "${FUNCNAME}: Best implementation is: ${impl}"
37 > - python_export "${impl}" "${@}"
38 > + debug-print "${FUNCNAME}: Best implementation is: ${best}"
39 > + python_export "${best}" "${@}"
40 > }
41 >
42 > # @FUNCTION: python_replicate_script
43 > --
44 > 1.8.1.5
45 >
46
47 Seems reasonable.