Gentoo Archives: gentoo-dev

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Patches to update toolchain.eclass to EAPI=5
Date: Sat, 30 Dec 2017 15:07:08
Message-Id: ff153a24-c525-0795-08be-9ec50dbd55bf@gentoo.org
In Reply to: Re: [gentoo-dev] Patches to update toolchain.eclass to EAPI=5 by "Anthony G. Basile"
1 On 12/30/17 9:13 AM, Anthony G. Basile wrote:
2 > On 12/30/17 9:08 AM, Michael Orlitzky wrote:
3 >> On 12/30/2017 07:22 AM, Anthony G. Basile wrote:
4 >>> use_if_iuse !nopie && return 0
5 >>
6 >> Does this work? The "use" function supports negation (undocumented, but
7 >> it's in the PMS), but I don't think use_if_iuse does.
8 >>
9 >
10 > Okay I'll read the code and test. You're right that I just assumed it
11 > worked liked "use" wrt negation so the semantics need to be checked.
12 >
13 > Thanks for looking this over carefully.
14 >
15
16 It looks like it would not work as expected because eutils.eclass has
17
18 in_iuse() {
19 debug-print-function ${FUNCNAME} "${@}"
20 [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()"
21
22 local flag=${1}
23 local liuse=( ${IUSE} )
24
25 has "${flag}" "${liuse[@]#[+-]}"
26 }
27
28 use_if_iuse() {
29 in_iuse $1 || return 1
30 use $1
31 }
32
33 So $1 in use_if_iuse binds to "!nopie" and then in in_iuse again to
34 "!nopie" which then messes up the has line, looking for a flag named
35 "!nopie" in IUSE which will always be true.
36
37 I'll change that line to
38
39 use_if_iuse nopie || return 0
40
41 Grepping the tree, I see only instances of
42
43 if ! use_if_iuse X ...
44
45 which is good.
46
47
48 --
49 Anthony G. Basile, Ph.D.
50 Gentoo Linux Developer [Hardened]
51 E-Mail : blueness@g.o
52 GnuPG FP : 1FED FAD9 D82C 52A5 3BAB DC79 9384 FA6E F52D 4BBA
53 GnuPG ID : F52D4BBA