summaryrefslogtreecommitdiffstats
path: root/bin/phase-helpers.sh
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2012-08-31 16:24:09 +0200
committerUlrich Müller <ulm@gentoo.org>2012-08-31 16:46:45 +0200
commitb9e2daded3663c59bf11b04e952bdfb4eb5deabf (patch)
tree4c080ef797254fa21d63cdbad5d56c6bf8f3e31d /bin/phase-helpers.sh
parentbcf4ab871ededc3d535165757ba5597669e33dcb (diff)
downloadportage-b9e2daded3663c59bf11b04e952bdfb4eb5deabf.tar.gz
portage-b9e2daded3663c59bf11b04e952bdfb4eb5deabf.tar.bz2
portage-b9e2daded3663c59bf11b04e952bdfb4eb5deabf.zip
EAPI 5: usex helper function
See bug #382963.
Diffstat (limited to 'bin/phase-helpers.sh')
-rw-r--r--bin/phase-helpers.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6899488d3..5f170fc00 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -174,6 +174,20 @@ usev() {
return 1
}
+case ${EAPI} in
+ 0|1|2|3|4) ;;
+ *)
+ usex() {
+ if use "$1"; then
+ echo "${2-yes}$4"
+ else
+ echo "${3-no}$5"
+ fi
+ return 0
+ }
+ ;;
+esac
+
use() {
local u=$1
local found=0