From 9f7e5ff5e4e19801c4252eac16810afa77820311 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 16 Nov 2015 08:09:03 +0100 Subject: [PATCH] eutils.eclass: in_iuse and einstalldocs are part of EAPI 6 Disable in_iuse and einstalldocs in EAPIs other than {0..5} since they are now part of EAPI. --- eclass/eutils.eclass | 80 +++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index c2a64e312dd6..a08aee40f7ee 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1512,15 +1512,17 @@ path_exists() { # as necessary. # # Note that this function should not be used in the global scope. -in_iuse() { - debug-print-function ${FUNCNAME} "${@}" - [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()" +if has "${EAPI:-0}" 0 1 2 3 4 5; then + in_iuse() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()" - local flag=${1} - local liuse=( ${IUSE} ) + local flag=${1} + local liuse=( ${IUSE} ) - has "${flag}" "${liuse[@]#[+-]}" -} + has "${flag}" "${liuse[@]#[+-]}" + } +fi # @FUNCTION: use_if_iuse # @USAGE: @@ -1714,42 +1716,44 @@ prune_libtool_files() { # # Passing additional options to dodoc and dohtml is not supported. # If you needed such a thing, you need to call those helpers explicitly. -einstalldocs() { - debug-print-function ${FUNCNAME} "${@}" - - local dodoc_opts=-r - has ${EAPI} 0 1 2 3 && dodoc_opts= - - if ! declare -p DOCS &>/dev/null ; then - local d - for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \ - THANKS BUGS FAQ CREDITS CHANGELOG ; do - if [[ -s ${d} ]] ; then - dodoc "${d}" || die +if has "${EAPI:-0}" 0 1 2 3 4 5; then + einstalldocs() { + debug-print-function ${FUNCNAME} "${@}" + + local dodoc_opts=-r + has ${EAPI} 0 1 2 3 && dodoc_opts= + + if ! declare -p DOCS &>/dev/null ; then + local d + for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \ + THANKS BUGS FAQ CREDITS CHANGELOG ; do + if [[ -s ${d} ]] ; then + dodoc "${d}" || die + fi + done + elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then + if [[ ${DOCS[@]} ]] ; then + dodoc ${dodoc_opts} "${DOCS[@]}" || die + fi + else + if [[ ${DOCS} ]] ; then + dodoc ${dodoc_opts} ${DOCS} || die fi - done - elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then - if [[ ${DOCS[@]} ]] ; then - dodoc ${dodoc_opts} "${DOCS[@]}" || die - fi - else - if [[ ${DOCS} ]] ; then - dodoc ${dodoc_opts} ${DOCS} || die fi - fi - if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then - if [[ ${HTML_DOCS[@]} ]] ; then - dohtml -r "${HTML_DOCS[@]}" || die - fi - else - if [[ ${HTML_DOCS} ]] ; then - dohtml -r ${HTML_DOCS} || die + if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then + if [[ ${HTML_DOCS[@]} ]] ; then + dohtml -r "${HTML_DOCS[@]}" || die + fi + else + if [[ ${HTML_DOCS} ]] ; then + dohtml -r ${HTML_DOCS} || die + fi fi - fi - return 0 -} + return 0 + } +fi check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; } -- 2.26.2