Gentoo Archives: gentoo-dev

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