From 43793fab84041cfc5c60c0151d1591b8a69fb24a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 25 Aug 2018 07:36:27 +0100 Subject: gentoo resync : 25.08.2018 --- eclass/eutils.eclass | 62 +++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 39 deletions(-) (limited to 'eclass/eutils.eclass') diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 9b4767e1874a..7b6336e2aee1 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -25,19 +25,6 @@ case ${EAPI:-0} in ;; esac -# @FUNCTION: eqawarn -# @USAGE: [message] -# @DESCRIPTION: -# Proxy to ewarn for package managers that don't provide eqawarn and use the PM -# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev -# profile. -if ! declare -F eqawarn >/dev/null ; then - eqawarn() { - has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@" - : - } -fi - # @FUNCTION: emktemp # @USAGE: [temp dir] # @DESCRIPTION: @@ -181,33 +168,11 @@ make_wrapper() { fi } -# @FUNCTION: path_exists -# @USAGE: [-a|-o] -# @DESCRIPTION: -# Check if the specified paths exist. Works for all types of paths -# (files/dirs/etc...). The -a and -o flags control the requirements -# of the paths. They correspond to "and" and "or" logic. So the -a -# flag means all the paths must exist while the -o flag means at least -# one of the paths must exist. The default behavior is "and". If no -# paths are specified, then the return value is "false". path_exists() { - local opt=$1 - [[ ${opt} == -[ao] ]] && shift || opt="-a" - - # no paths -> return false - # same behavior as: [[ -e "" ]] - [[ $# -eq 0 ]] && return 1 - - local p r=0 - for p in "$@" ; do - [[ -e ${p} ]] - : $(( r += $? )) - done - - case ${opt} in - -a) return $(( r != 0 )) ;; - -o) return $(( r == $# )) ;; - esac + eerror "path_exists has been removed. Please see the following post" + eerror "for a replacement snippet:" + eerror "https://blogs.gentoo.org/mgorny/2018/08/09/inlining-path_exists/" + die "path_exists is banned" } # @FUNCTION: use_if_iuse @@ -415,4 +380,23 @@ in_iuse() { ;; esac +case ${EAPI:-0} in +0|1|2|3|4|5|6) + +# @FUNCTION: eqawarn +# @USAGE: [message] +# @DESCRIPTION: +# Proxy to ewarn for package managers that don't provide eqawarn and use the PM +# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev +# profile. +if ! declare -F eqawarn >/dev/null ; then + eqawarn() { + has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@" + : + } +fi + +;; +esac + fi -- cgit v1.2.3