summaryrefslogtreecommitdiffstats
path: root/bin/isolated-functions.sh
diff options
context:
space:
mode:
authorDror Levin <spatz@gentoo.org>2010-05-26 23:23:38 +0300
committerZac Medico <zmedico@gentoo.org>2010-08-12 01:39:43 -0700
commit65c1a6e0dddf0d99af7adbd41484150d5fc6ef9c (patch)
treef7f1bd8c5215758ec7e21c8ec8eb0ba725688c63 /bin/isolated-functions.sh
parentef30f84cc7e91bf777f505384dd9869606d4dc5f (diff)
downloadportage-65c1a6e0dddf0d99af7adbd41484150d5fc6ef9c.tar.gz
portage-65c1a6e0dddf0d99af7adbd41484150d5fc6ef9c.tar.bz2
portage-65c1a6e0dddf0d99af7adbd41484150d5fc6ef9c.zip
Make utilities die on failure in EAPI 4, bug 273651
Diffstat (limited to 'bin/isolated-functions.sh')
-rw-r--r--bin/isolated-functions.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index fb6ad64ff..ddcf8f0d7 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -70,6 +70,17 @@ nonfatal() {
PORTAGE_NONFATAL=1 "$@"
}
+helpers_die() {
+ case "${EAPI:-0}" in
+ 0|1|2|3)
+ echo -e "$@" >&2
+ ;;
+ *)
+ die "$@"
+ ;;
+ esac
+}
+
die() {
if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2