diff options
author | Michael Palimaka <kensington@gentoo.org> | 2016-01-26 01:04:15 +1100 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2016-01-26 01:07:07 +1100 |
commit | e9116b1aebc819a10410960cbb4931aa5e399af1 (patch) | |
tree | 030f6552853498db37521902d6e3bfd5f782b92e /eclass | |
parent | cmake-utils.eclass: require two arguments for cmake-utils_use_find_package in... (diff) | |
download | gentoo-e9116b1aebc819a10410960cbb4931aa5e399af1.tar.gz gentoo-e9116b1aebc819a10410960cbb4931aa5e399af1.tar.bz2 gentoo-e9116b1aebc819a10410960cbb4931aa5e399af1.zip |
cmake-utils.eclass: ban helper functions in EAPI 6 and later
The affected helpers are:
* cmake-utils_use_build
* cmake-utils_use_disable
* cmake-utils_use_enable
* cmake-utils_use_has
* cmake-utils_use_no
* cmake-utils_use_use
* cmake-utils_use_want
* cmake-utils_use_with
* cmake-utils_use
* cmake-utils_useno
https://archives.gentoo.org/gentoo-dev/message/6ff6dedb44fff4289764dc5eb960e1c6
Gentoo-bug: 514384
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cmake-utils.eclass | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 8ed1ce9bc43e..6ae357be782b 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -161,6 +161,11 @@ unset CMAKEDEPEND _cmake_use_me_now() { debug-print-function ${FUNCNAME} "$@" + local arg=$2 + [[ ! -z $3 ]] && arg=$3 + + has "${EAPI:-0}" 2 3 4 5 || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead" + local uper capitalised x [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" if [[ ! -z $3 ]]; then @@ -178,6 +183,13 @@ _cmake_use_me_now() { _cmake_use_me_now_inverted() { debug-print-function ${FUNCNAME} "$@" + local arg=$2 + [[ ! -z $3 ]] && arg=$3 + + if ! has "${EAPI:-0}" 2 3 4 5 && [[ "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then + die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" insteadss" + fi + local uper capitalised x [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]" if [[ ! -z $3 ]]; then |