Gentoo Archives: gentoo-dev

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-dev@l.g.o, Sergei Trofimovich <slyfox@g.o>
Subject: Re: [gentoo-dev] [PATCH v2 2/5] flag-o-matic.eclass: get rid of eutils in <EAPI-8, fix eclassdoc, make some funcs internal
Date: Thu, 01 Apr 2021 09:58:15
Message-Id: 2127539.vFx2qVVIhK@tuxbook
In Reply to: Re: [gentoo-dev] [PATCH v2 1/5] flag-o-matic.eclass: get rid of eutils in by Andreas Sturmlechner
1 From 6d1c665d06186dde5361905d5fb2057e044b040e Mon Sep 17 00:00:00 2001
2 From: Andreas Sturmlechner <asturm@g.o>
3 Date: Wed, 31 Mar 2021 00:22:12 +0200
4 Subject: [PATCH 2/5] flag-o-matic.eclass: Make setup-allowed-flags() internal
5
6 Signed-off-by: Andreas Sturmlechner <asturm@g.o>
7 ---
8 eclass/flag-o-matic.eclass | 16 +++++++++++++++-
9 1 file changed, 15 insertions(+), 1 deletion(-)
10
11 diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
12 index ab79f70392d..d511a140592 100644
13 --- a/eclass/flag-o-matic.eclass
14 +++ b/eclass/flag-o-matic.eclass
15 @@ -26,9 +26,23 @@ all-flag-vars() {
16 echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS
17 }
18
19 +# @FUNCTION: setup-allowed-flags
20 +# @INTERNAL
21 +# @DESCRIPTION:
22 # {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
23 # Note: shell globs and character lists are allowed
24 setup-allowed-flags() {
25 + [[ ${EAPI} == [5-7] ]] ||
26 + die "Internal function ${FUNCNAME} is not available in >=EAPI-8."
27 + _setup-allowed-flags
28 +}
29 +
30 +# @FUNCTION: _setup-allowed-flags
31 +# @INTERNAL
32 +# @DESCRIPTION:
33 +# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
34 +# Note: shell globs and character lists are allowed
35 +_setup-allowed-flags() {
36 ALLOWED_FLAGS=(
37 -pipe -O '-O[12sg]' -mcpu -march -mtune
38 '-fstack-protector*' '-fsanitize*' '-fstack-check*' -fno-stack-check
39 @@ -412,7 +426,7 @@ strip-flags() {
40 local x y var
41
42 local ALLOWED_FLAGS
43 - setup-allowed-flags
44 + _setup-allowed-flags
45
46 set -f # disable pathname expansion
47
48 --
49 2.31.0

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies