summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-02-27 21:02:59 +0000
committerMichał Górny <mgorny@gentoo.org>2013-02-27 21:02:59 +0000
commitb4ac256d85f7fd85f07793bec878385fcd1dff50 (patch)
treed92b9dfaac485d046feba0fadc6f27035e9c0469 /eclass/distutils-r1.eclass
parentAdded 1.2.12 and stablized 1.2.2 (diff)
downloadhistorical-b4ac256d85f7fd85f07793bec878385fcd1dff50.tar.gz
historical-b4ac256d85f7fd85f07793bec878385fcd1dff50.tar.bz2
historical-b4ac256d85f7fd85f07793bec878385fcd1dff50.zip
Revert the log teeing changes as they cause unexpected kind of breakage.
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass63
1 files changed, 55 insertions, 8 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 77b8fc8b0582..4db8392ce391 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.56 2013/02/26 14:34:32 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.57 2013/02/27 21:02:59 mgorny Exp $
# @ECLASS: distutils-r1
# @MAINTAINER:
@@ -100,6 +100,14 @@ if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
DEPEND=${PYTHON_DEPS}
fi
+# @ECLASS-VARIABLE: DISTUTILS_JOBS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The number of parallel jobs to run for distutils-r1 parallel builds.
+# If unset, the job-count in ${MAKEOPTS} will be used.
+#
+# This variable is intended to be set in make.conf.
+
# @ECLASS-VARIABLE: PATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -550,7 +558,16 @@ distutils-r1_run_phase() {
mkdir -p "${TMPDIR}" || die
- "${@}"
+ if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]]
+ then
+ "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
+ else
+ (
+ multijob_child_init
+ "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
+ ) &
+ multijob_post_fork
+ fi
if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
then
@@ -582,6 +599,39 @@ _distutils-r1_run_common_phase() {
"${@}"
}
+# @FUNCTION: _distutils-r1_multijob_init
+# @INTERNAL
+# @DESCRIPTION:
+# Init multijob, taking the job-count from ${DISTUTILS_JOBS}.
+_distutils-r1_multijob_init() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
+ then
+ local opts
+ if [[ ${DISTUTILS_JOBS} ]]; then
+ opts=-j${DISTUTILS_JOBS}
+ else
+ opts=${MAKEOPTS}
+ fi
+
+ multijob_init "${opts}"
+ fi
+}
+
+# @FUNCTION: _distutils-r1_multijob_finish
+# @INTERNAL
+# @DESCRIPTION:
+# Finish multijob if used.
+_distutils-r1_multijob_finish() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
+ then
+ multijob_finish
+ fi
+}
+
# @FUNCTION: _distutils-r1_run_foreach_impl
# @INTERNAL
# @DESCRIPTION:
@@ -593,12 +643,9 @@ _distutils-r1_run_foreach_impl() {
set -- distutils-r1_run_phase "${@}"
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]]
- then
- python_foreach_impl "${@}"
- else
- python_parallel_foreach_impl "${@}"
- fi
+ _distutils-r1_multijob_init
+ python_foreach_impl "${@}"
+ _distutils-r1_multijob_finish
else
if [[ ! ${EPYTHON} ]]; then
die "EPYTHON unset, python-single-r1_pkg_setup not called?!"