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. |