Gentoo Archives: gentoo-dev

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

Replies