diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-02-26 14:32:49 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-02-26 14:32:49 +0000 |
commit | 5732036722d812276724068061a6fa372275b586 (patch) | |
tree | 021f92f645ae53d8cc48ad3d0c865482ea3ffdbb /eclass | |
parent | Version bump to latest. (diff) | |
download | gentoo-2-5732036722d812276724068061a6fa372275b586.tar.gz gentoo-2-5732036722d812276724068061a6fa372275b586.tar.bz2 gentoo-2-5732036722d812276724068061a6fa372275b586.zip |
Make python_foreach_impl() non-fatal, expect explicit die inside or outside.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/python-r1.eclass | 17 |
2 files changed, 17 insertions, 5 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 48639c242413..a0d18122661b 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.684 2013/02/25 20:27:27 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.685 2013/02/26 14:32:49 mgorny Exp $ + + 26 Feb 2013; Michał Górny <mgorny@gentoo.org> python-r1.eclass: + Make python_foreach_impl() non-fatal, expect explicit die inside or outside. 25 Feb 2013; Michał Górny <mgorny@gentoo.org> xorg-2.eclass: Bump the emul-linux-x86 blocker to match the new release. diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 5735a6d91314..5b2e8b6b4da1 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.40 2013/01/30 10:42:25 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.41 2013/02/26 14:32:49 mgorny Exp $ # @ECLASS: python-r1 # @MAINTAINER: @@ -583,8 +583,11 @@ _python_check_USE_PYTHON() { # @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. If the command fails, python_foreach_impl dies. -# If necessary, use ':' to force a successful return. +# 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. @@ -596,6 +599,7 @@ python_foreach_impl() { local impl local bdir=${BUILD_DIR:-${S}} + local ret=0 lret=0 debug-print "${FUNCNAME}: bdir = ${bdir}" for impl in "${_PYTHON_ALL_IMPLS[@]}"; do @@ -609,9 +613,14 @@ python_foreach_impl() { export EPYTHON PYTHON einfo "${EPYTHON}: running ${@}" - "${@}" || die "${EPYTHON}: ${1} failed" + "${@}" + lret=${?} + + [[ ${ret} -eq 0 && ${lret} -ne 0 ]] && ret=${lret} fi done + + return ${ret} } # @FUNCTION: python_export_best |