Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] linux-mod.eclass: IUSE default support for MODULES_OPTIONAL_USE
Date: Mon, 15 Jan 2018 23:47:57
Message-Id: robbat2-20180115T234605-078394673Z@orbis-terrarum.net
In Reply to: Re: [gentoo-dev] [PATCH] linux-mod.eclass: IUSE default support for MODULES_OPTIONAL_USE by William Hubbs
1 On Mon, Jan 15, 2018 at 02:26:19PM -0600, William Hubbs wrote:
2 > On Mon, Jan 15, 2018 at 01:34:12PM -0500, Michael Orlitzky wrote:
3 > > On 01/14/2018 06:53 PM, Robin H. Johnson wrote:
4 > > > +# @ECLASS-VARIABLE: MODULES_OPTIONAL_USE_IUSE_DEFAULT
5 > > > +# @DESCRIPTION:
6 > > > +# A boolean to control the IUSE default state for the MODULES_OPTIONAL_USE USE
7 > > > +# flag. Default value is unset (false). True represented by 1 or 'on', other
8 > > > +# values including unset treated as false.
9 ..
10 > > > +case $MODULES_OPTIONAL_USE_IUSE_DEFAULT in
11 > > > + 1) _modules_optional_use_iuse_default='+' ;;
12 > > > + *) _modules_optional_use_iuse_default='' ;;
13 > > > +esac
14 > >
15 > > I missed this the first time around, but the case statement needs to
16 > > catch "on", too.
17 > and possibly all other case combinations of on, so On oN ON also have to
18 > be caught,
19 >
20 > And since you define it as a boolean, you also need to worry about all
21 > combinations of true.
22 I'd update the documentation rather, and explicitly state that '1' is
23 the only value accepted for enabling it.
24
25 > Honestly what I would do is kill the case completely and use something
26 > like this:
27 >
28 > +if [ -n "${MODULES_OPTIONAL_USE_IUSE_DEFAULT}" ]; then
29 > + _modules_optional_use_iuse_default='+'
30 > +fi
31 That is counter-intuitive for somebody that puts
32 MODULES_OPTIONAL_USE_IUSE_DEFAULT=0
33 Or tries to otherwise have it unset.
34
35
36 --
37 Robin Hugh Johnson
38 Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
39 E-Mail : robbat2@g.o
40 GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
41 GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

Attachments

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

Replies