diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-08-18 12:04:46 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-12-04 15:01:35 +0100 |
commit | 65c1b97870b6689d5b065540d0e46fa7cb4de7bc (patch) | |
tree | 027cad897259802fd8853e05df2c7bcc0adb60a8 /bin/phase-helpers.sh | |
parent | Add tentative EAPI6 nonfatal support to die() (diff) | |
download | portage-65c1b97870b6689d5b065540d0e46fa7cb4de7bc.tar.gz portage-65c1b97870b6689d5b065540d0e46fa7cb4de7bc.tar.bz2 portage-65c1b97870b6689d5b065540d0e46fa7cb4de7bc.zip |
Add tentative EAPI6 in_iuse() function
Add a function to query IUSE_EFFECTIVE for flags.
Diffstat (limited to 'bin/phase-helpers.sh')
-rw-r--r-- | bin/phase-helpers.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index a6e1cdb96..e2376bffd 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 |