Gentoo Archives: gentoo-dev

From: Michael Palimaka <kensington@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [PATCH 13/15] cmake-utils.eclass: ban helper functions in EAPI 6 and later
Date: Fri, 22 Jan 2016 09:40:18
Message-Id: n7st7s$rgp$3@ger.gmane.org
In Reply to: Re: [gentoo-dev] [PATCH 13/15] cmake-utils.eclass: ban helper functions in EAPI 6 and later by "Michał Górny"
1 On 01/22/2016 03:31 AM, Michał Górny wrote:
2 > Dnia 20 stycznia 2016 11:43:11 CET, Michael Palimaka <kensington@g.o> napisał(a):
3 >> https://archives.gentoo.org/gentoo-dev/message/6ff6dedb44fff4289764dc5eb960e1c6
4 >>
5 >> Gentoo-bug: 514384
6 >> ---
7 >> eclass/cmake-utils.eclass | 12 ++++++++++++
8 >> 1 file changed, 12 insertions(+)
9 >>
10 >> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
11 >> index 960b34b..507d27d 100644
12 >> --- a/eclass/cmake-utils.eclass
13 >> +++ b/eclass/cmake-utils.eclass
14 >> @@ -161,6 +161,11 @@ unset CMAKEDEPEND
15 >> _cmake_use_me_now() {
16 >> debug-print-function ${FUNCNAME} "$@"
17 >>
18 >> + local arg=$2
19 >> + [[ ! -z $3 ]] && arg=$3
20 >> +
21 >> + has "${EAPI:-0}" 2 3 4 5 || die "${FUNCNAME[1]} is banned in EAPI 6
22 >> and later: use -D$1${arg}=\"\$(usex $2)\" instead"
23 >> +
24 >> local uper capitalised x
25 >> [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
26 >> if [[ ! -z $3 ]]; then
27 >> @@ -178,6 +183,13 @@ _cmake_use_me_now() {
28 >> _cmake_use_me_now_inverted() {
29 >> debug-print-function ${FUNCNAME} "$@"
30 >>
31 >> + local arg=$2
32 >> + [[ ! -z $3 ]] && arg=$3
33 >> +
34 >> + if ! has "${EAPI:-0}" 2 3 4 5 && [[ "${FUNCNAME[1]}" !=
35 >> cmake-utils_use_find_package ]] ; then
36 >> + die "${FUNCNAME[1]} is banned in EAPI 6 and later: use
37 >> -D$1${arg}=\"\$(usex $2)\" insteadss"
38 >> + fi
39 >> +
40 >> local uper capitalised x
41 >> [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
42 >> if [[ ! -z $3 ]]; then
43 >
44 > I suggest making it more explicit what kind of helper functions are banned in the commit message.
45 >
46
47 I'll add the full list of affected functions.