commit: 65c1b97870b6689d5b065540d0e46fa7cb4de7bc
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 18 10:04:46 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Dec 4 14:01:35 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=65c1b978
Add tentative EAPI6 in_iuse() function
Add a function to query IUSE_EFFECTIVE for flags.
---
bin/eapi.sh | 4 ++++
bin/phase-helpers.sh | 16 ++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/bin/eapi.sh b/bin/eapi.sh
index c650a4c..e0ade02 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -80,6 +80,10 @@ ___eapi_has_eapply_user() {
[[ ! ${1-${EAPI}} =~
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
}
+___eapi_has_in_iuse() {
+ [[ ! ${1-${EAPI}} =~
^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
___eapi_has_master_repositories() {
[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
}
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index a6e1cdb..e2376bf 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1036,6 +1036,22 @@ if ___eapi_has_eapply_user; then
}
fi
+if ___eapi_has_in_iuse; then
+ in_iuse() {
+ local use=${1}
+
+ if [[ -z "${use}" ]]; then
+ echo "!!! in_iuse() called without a parameter." >&2
+ echo "!!! in_iuse <USEFLAG>" >&2
+ die "in_iuse() called without a parameter"
+ fi
+
+ local liuse=( ${IUSE_EFFECTIVE} )
+
+ has "${use}" "${liuse[@]#[+-]}"
+ }
+fi
+
if ___eapi_has_master_repositories; then
master_repositories() {
local output repository=$1 retval