Gentoo Archives: gentoo-dev

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

Replies

Subject Author
Re: [gentoo-dev] [PATCH] fcaps.eclass: support EAPI 8 Ulrich Mueller <ulm@g.o>