summaryrefslogtreecommitdiff
path: root/eclass/eutils.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-08-25 07:36:27 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-08-25 07:36:27 +0100
commit43793fab84041cfc5c60c0151d1591b8a69fb24a (patch)
tree6208a7f4fc744684fce0f55acbb47511acace498 /eclass/eutils.eclass
parent28e3d252dc8ac8a5635206dfefe1cfe05058d1db (diff)
gentoo resync : 25.08.2018
Diffstat (limited to 'eclass/eutils.eclass')
-rw-r--r--eclass/eutils.eclass62
1 files changed, 23 insertions, 39 deletions
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] <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
@@ -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