Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-dev@l.g.o, David Michael <fedora.dm0@×××××.com>, base-system@g.o
Subject: Re: [gentoo-dev] [PATCH] fcaps.eclass: support EAPI 8
Date: Thu, 17 Jun 2021 11:02:18
Message-Id: u7dis7o0g@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] fcaps.eclass: support EAPI 8 by "Michał Górny"
1 >>>>> On Thu, 17 Jun 2021, Michał Górny wrote:
2
3 > On Thu, 2021-06-17 at 12:10 +0200, Ulrich Mueller wrote:
4 >> > > > > > On Thu, 17 Jun 2021, David Michael wrote:
5 >>
6 >> > @@ -33,15 +34,12 @@ _FCAPS_ECLASS=1
7 >> >  
8 >> >  IUSE="+filecaps"
9 >> >  
10 >> > -# Since it is needed in pkg_postinst() it must be in RDEPEND
11 >> > +# Since it is needed in pkg_postinst() it must be in IDEPEND
12 >> >  case "${EAPI:-0}" in
13 >> > - [0-6])
14 >> > - RDEPEND="filecaps? ( sys-libs/libcap )"
15 >> > - ;;
16 >> > - *)
17 >> > - BDEPEND="filecaps? ( sys-libs/libcap )"
18 >> > - RDEPEND="${BDEPEND}"
19 >> > - ;;
20 >> > + 7) BDEPEND="filecaps? ( sys-libs/libcap )" ;&
21 >>
22 >> This is ill-defined in old EAPIs (5 and before), so the case statement
23 >> may fail. You cannot use ;& in global scope of an eclass.
24 >>
25 >> Why not just change * to 7, and add a new case for 8? It's one
26 >> additional line, and IMHO would be better readable than having a
27 >> fallthrough.
28
29 > I've already left a comment on the PR suggesting to split it into two
30 > cases: one to check for valid EAPI, the other for deps. It would be
31 > cleaner IMO, as the second case would cover all future EAPIs via *,
32 > and the first one would prevent the syntax error from applying to old
33 > EAPIs (I've tested that).
34
35 That would work too. But please add a comment making it clear that there
36 is a fallthrough.
37
38 Ulrich

Attachments

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

Replies

Subject Author
Re: [gentoo-dev] [PATCH] fcaps.eclass: support EAPI 8 David Michael <fedora.dm0@×××××.com>