eutils.eclass: in_iuse and einstalldocs are part of EAPI 6
authorMichał Górny <mgorny@gentoo.org>
Mon, 16 Nov 2015 07:09:03 +0000 (08:09 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 16 Nov 2015 07:13:31 +0000 (08:13 +0100)
Disable in_iuse and einstalldocs in EAPIs other than {0..5} since they
are now part of EAPI.

eclass/eutils.eclass

index c2a64e312dd638919289a44f0e1ef44c1b2d2aee..a08aee40f7ee706945c2512fb7ae75e4bcb68ad0 100644 (file)
@@ -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: <flag>
@@ -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"; }