Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Cc: Ulrich Mueller <ulm@g.o>
Subject: Re: [gentoo-dev] patch eutils.eclass for EAPI 5
Date: Thu, 27 Sep 2012 17:24:52
Message-Id: 50648BA6.90701@gentoo.org
In Reply to: Re: [gentoo-dev] patch eutils.eclass for EAPI 5 by Zac Medico
1 On 09/27/2012 10:07 AM, Zac Medico wrote:
2 > On 09/27/2012 09:49 AM, Ulrich Mueller wrote:
3 >> As far as I can see, only the definition of the usex function must be
4 >> disabled. Please review the patch included below.
5 >>
6 >> Ulrich
7 >>
8 >> --- eutils.eclass 15 Sep 2012 16:16:53 -0000 1.403
9 >> +++ eutils.eclass 27 Sep 2012 16:45:14 -0000
10 >> @@ -1373,7 +1373,9 @@
11 >> # @DESCRIPTION:
12 >> # If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
13 >> # otherwise echo [false output][false suffix] (defaults to "no").
14 >> +if has "${EAPI:-0}" 0 1 2 3 4; then
15 >> usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963
16 >> +fi
17 >>
18 >> # @FUNCTION: prune_libtool_files
19 >> # @USAGE: [--all]
20 >>
21 >
22 > Looks good to me.
23 >
24 > It may not work for unofficial EAPIs that don't include usex, but I
25 > guess there's nothing we can do for those, and they can just be replaced
26 > with newer EAPIs that include usex.
27
28 Something like this would work with current versions of portage:
29
30 if ! declare -F usex >/dev/null ; then
31 usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; }
32 fi
33
34 However, it's probably not a good idea to assume that the package
35 manager defines usex prior to sourcing the eclass.
36 --
37 Thanks,
38 Zac

Replies

Subject Author
[gentoo-dev] Re: patch eutils.eclass for EAPI 5 Ulrich Mueller <ulm@g.o>
Re: [gentoo-dev] patch eutils.eclass for EAPI 5 Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>