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 5/5] Re-enable split logs, now in python*_foreach_impl().
Date: Thu, 21 Feb 2013 22:10:06
Message-Id: 1361484605-13363-5-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 This provides the split logs accessible to every Python package, not
2 only ones using distutils.
3 ---
4 gx86/eclass/python-r1.eclass | 16 +++++++++++++---
5 1 file changed, 13 insertions(+), 3 deletions(-)
6
7 diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
8 index 09e6417..1b26513 100644
9 --- a/gx86/eclass/python-r1.eclass
10 +++ b/gx86/eclass/python-r1.eclass
11 @@ -620,8 +620,17 @@ python_foreach_impl() {
12 local BUILD_DIR=${bdir%%/}-${impl}
13 export EPYTHON PYTHON
14
15 - einfo "${EPYTHON}: running ${@}"
16 - "${@}"
17 + einfo "${EPYTHON}: running ${@}" \
18 + | tee -a "${T}/build-${EPYTHON}.log"
19 +
20 + # _python_parallel() does redirection internally.
21 + # note: this is a hidden API to avoid writing python_foreach_impl
22 + # twice. do *not* even think of using it anywhere else.
23 + if [[ ${1} == _python_parallel ]]; then
24 + "${@}"
25 + else
26 + "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
27 + fi
28 lret=${?}
29
30 [[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret}
31 @@ -655,7 +664,8 @@ python_parallel_foreach_impl() {
32 _python_parallel() {
33 (
34 multijob_child_init
35 - "${@}"
36 + "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
37 + exit ${PIPESTATUS[0]}
38 ) &
39 multijob_post_fork
40 }
41 --
42 1.8.1.2

Replies