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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies