diff options
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r-- | eclass/python-r1.eclass | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 5bcb8cca3fa9..934f32d5a543 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-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/python-r1.eclass,v 1.46 2013/03/04 19:27:58 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.47 2013/03/04 19:28:47 mgorny Exp $ # @ECLASS: python-r1 # @MAINTAINER: @@ -173,6 +173,14 @@ _python_set_globals() { } _python_set_globals +# @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. + # @FUNCTION: _python_validate_useflags # @INTERNAL # @DESCRIPTION: @@ -634,6 +642,31 @@ python_foreach_impl() { multibuild_foreach_variant _python_multibuild_wrapper "${@}" } +# @FUNCTION: python_parallel_foreach_impl +# @USAGE: <command> [<args>...] +# @DESCRIPTION: +# Run the given command for each of the enabled Python implementations. +# If additional parameters are passed, they will be passed through +# to the command. +# +# The function will return 0 status if all invocations succeed. +# Otherwise, the return code from first failing invocation will +# be returned. +# +# For each command being run, EPYTHON, PYTHON and BUILD_DIR are set +# locally, and the former two are exported to the command environment. +# +# Multiple invocations of the command will be run in parallel, up to +# DISTUTILS_JOBS (defaulting to '-j' option argument from MAKEOPTS). +python_parallel_foreach_impl() { + debug-print-function ${FUNCNAME} "${@}" + + local MULTIBUILD_JOBS=${MULTIBUILD_JOBS:-${DISTUTILS_JOBS}} + local MULTIBUILD_VARIANTS + _python_obtain_impls + multibuild_parallel_foreach_variant _python_multibuild_wrapper "${@}" +} + # @FUNCTION: python_export_best # @USAGE: [<variable>...] # @DESCRIPTION: |