summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2011-04-15 20:06:07 +0000
committerMichał Górny <mgorny@gentoo.org>2011-04-15 20:06:07 +0000
commit1d5d1d47c97ca3ddf61b6cb2ead42617c56061f9 (patch)
treefa79d23e9656c53776e194974d9ade90e24ed28e /eclass/scons-utils.eclass
parentRe-manifest again (for Diego). (diff)
downloadgentoo-2-1d5d1d47c97ca3ddf61b6cb2ead42617c56061f9.tar.gz
gentoo-2-1d5d1d47c97ca3ddf61b6cb2ead42617c56061f9.tar.bz2
gentoo-2-1d5d1d47c97ca3ddf61b6cb2ead42617c56061f9.zip
Check for EAPI. Make escons fatal in EAPI 4.
Diffstat (limited to 'eclass/scons-utils.eclass')
-rw-r--r--eclass/scons-utils.eclass18
1 files changed, 16 insertions, 2 deletions
diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index eac223e3c92d..508f252ad0be 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/scons-utils.eclass,v 1.3 2011/02/07 14:55:08 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/scons-utils.eclass,v 1.4 2011/04/15 20:06:07 mgorny Exp $
# @ECLASS: scons-utils.eclass
# @MAINTAINER:
@@ -51,6 +51,13 @@
# The default value for false in scons-use() (0 by default).
: ${USE_SCONS_FALSE:=0}
+# -- EAPI support check --
+
+case ${EAPI:-0} in
+ 0|1|2|3|4) ;;
+ *) die "EAPI ${EAPI} unsupported."
+esac
+
# -- ebuild variables setup --
if [[ -n ${SCONS_MIN_VERSION} ]]; then
@@ -65,14 +72,21 @@ fi
# @USAGE: [scons-arg] ...
# @DESCRIPTION:
# Call scons, passing the supplied arguments, ${MAKEOPTS} and
-# ${EXTRA_ESCONS}. Similar to emake.
+# ${EXTRA_ESCONS}. Similar to emake. Like emake, this function does die
+# on failure in EAPI 4 (unless called nonfatal).
escons() {
+ local ret
+
debug-print-function ${FUNCNAME} "${@}"
# if SCONSOPTS are _unset_, use cleaned MAKEOPTS
set -- scons ${SCONSOPTS-$(scons_clean_makeopts)} ${EXTRA_ESCONS} "${@}"
echo "${@}" >&2
"${@}"
+ ret=${?}
+
+ [[ ${ret} -ne 0 && ${EAPI:-0} -ge 4 ]] && die "escons failed."
+ return ${ret}
}
# @FUNCTION: scons_clean_makeopts