Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH 4/5] Use python_parallel_foreach_impl() in distutils-r1.
Date: Thu, 21 Feb 2013 22:10:04
Message-Id: 1361484605-13363-4-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-python] [PATCHES] Cleaning python_foreach_impl() up and introduce a parallel variant by "Michał Górny"
1 ---
2 gx86/eclass/distutils-r1.eclass | 53 ++++++-----------------------------------
3 1 file changed, 7 insertions(+), 46 deletions(-)
4
5 diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
6 index adb5d42..42b48bc 100644
7 --- a/gx86/eclass/distutils-r1.eclass
8 +++ b/gx86/eclass/distutils-r1.eclass
9 @@ -525,16 +525,7 @@ distutils-r1_run_phase() {
10
11 mkdir -p "${TMPDIR}" || die
12
13 - if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]]
14 - then
15 - "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
16 - else
17 - (
18 - multijob_child_init
19 - "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
20 - ) &
21 - multijob_post_fork
22 - fi
23 + "${@}"
24
25 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
26 then
27 @@ -566,39 +557,6 @@ _distutils-r1_run_common_phase() {
28 "${@}"
29 }
30
31 -# @FUNCTION: _distutils-r1_multijob_init
32 -# @INTERNAL
33 -# @DESCRIPTION:
34 -# Init multijob, taking the job-count from ${DISTUTILS_JOBS}.
35 -_distutils-r1_multijob_init() {
36 - debug-print-function ${FUNCNAME} "${@}"
37 -
38 - if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
39 - then
40 - local opts
41 - if [[ ${DISTUTILS_JOBS} ]]; then
42 - opts=-j${DISTUTILS_JOBS}
43 - else
44 - opts=${MAKEOPTS}
45 - fi
46 -
47 - multijob_init "${opts}"
48 - fi
49 -}
50 -
51 -# @FUNCTION: _distutils-r1_multijob_finish
52 -# @INTERNAL
53 -# @DESCRIPTION:
54 -# Finish multijob if used.
55 -_distutils-r1_multijob_finish() {
56 - debug-print-function ${FUNCNAME} "${@}"
57 -
58 - if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
59 - then
60 - multijob_finish
61 - fi
62 -}
63 -
64 # @FUNCTION: _distutils-r1_run_foreach_impl
65 # @INTERNAL
66 # @DESCRIPTION:
67 @@ -610,9 +568,12 @@ _distutils-r1_run_foreach_impl() {
68 set -- distutils-r1_run_phase "${@}"
69
70 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
71 - _distutils-r1_multijob_init
72 - python_foreach_impl "${@}"
73 - _distutils-r1_multijob_finish
74 + if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]]
75 + then
76 + python_foreach_impl "${@}"
77 + else
78 + python_parallel_foreach_impl "${@}"
79 + fi
80 else
81 if [[ ! ${EPYTHON} ]]; then
82 die "EPYTHON unset, python-single-r1_pkg_setup not called?!"
83 --
84 1.8.1.2