Skip to content

Commit

Permalink
cmake-utils.eclass: ban helper functions in EAPI 6 and later
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kensington committed Jan 25, 2016
1 parent 6f2b781 commit e9116b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions eclass/cmake-utils.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e9116b1

Please sign in to comment.