summaryrefslogtreecommitdiffstats
path: root/bin/isolated-functions.sh
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-09-26 22:31:20 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-09-26 22:31:20 +0200
commitab46499322311c1faa710c63d0a5339e49a9061a (patch)
tree2461ce1b29a6c5631b66bdfa1e730394fddca617 /bin/isolated-functions.sh
parentc371cb4d1a1858c6271af9abee53b1dcc28d5435 (diff)
downloadportage-ab46499322311c1faa710c63d0a5339e49a9061a.tar.gz
portage-ab46499322311c1faa710c63d0a5339e49a9061a.tar.bz2
portage-ab46499322311c1faa710c63d0a5339e49a9061a.zip
Add eapi.sh with ___eapi_*() functions and use these functions in other files.
Diffstat (limited to 'bin/isolated-functions.sh')
-rw-r--r--bin/isolated-functions.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index fa84c7ee3..f8e7862ee 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -2,6 +2,8 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/eapi.sh"
+
# We need this next line for "die" and "assert". It expands
# It _must_ preceed all the calls to die and assert.
shopt -s expand_aliases
@@ -86,7 +88,7 @@ __dump_trace() {
}
nonfatal() {
- if has "${EAPI:-0}" 0 1 2 3 ; then
+ if ! ___eapi_has_nonfatal; then
die "$FUNCNAME() not supported in this EAPI"
fi
if [[ $# -lt 1 ]]; then
@@ -97,14 +99,11 @@ nonfatal() {
}
__helpers_die() {
- case "${EAPI:-0}" in
- 0|1|2|3)
- echo -e "$@" >&2
- ;;
- *)
- die "$@"
- ;;
- esac
+ if ___eapi_helpers_can_die; then
+ die "$@"
+ else
+ echo -e "$@" >&2
+ fi
}
die() {