diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-08-09 17:11:04 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-08-15 09:31:00 +0200 |
commit | 5f97ce827b9db74b9b5ebf76f868726180d07ebb (patch) | |
tree | 4629448184a445cb59447c00eeaedefc316d06ed /eclass/eutils.eclass | |
parent | autotools-utils.eclass: Remove EAPI 2&3 support (diff) | |
download | gentoo-5f97ce827b9db74b9b5ebf76f868726180d07ebb.tar.gz gentoo-5f97ce827b9db74b9b5ebf76f868726180d07ebb.tar.bz2 gentoo-5f97ce827b9db74b9b5ebf76f868726180d07ebb.zip |
eutils.eclass: Ban path_exists
Closes: https://github.com/gentoo/gentoo/pull/9517
Diffstat (limited to 'eclass/eutils.eclass')
-rw-r--r-- | eclass/eutils.eclass | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index e5d0ebeebb06..7b6336e2aee1 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -168,33 +168,11 @@ make_wrapper() { fi } -# @FUNCTION: path_exists -# @USAGE: [-a|-o] <paths> -# @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 |