1 |
>>>>> On Thu, 27 Sep 2012, Zac Medico wrote: |
2 |
|
3 |
>>> --- eutils.eclass 15 Sep 2012 16:16:53 -0000 1.403 |
4 |
>>> +++ eutils.eclass 27 Sep 2012 16:45:14 -0000 |
5 |
>>> @@ -1373,7 +1373,9 @@ |
6 |
>>> # @DESCRIPTION: |
7 |
>>> # If USE flag is set, echo [true output][true suffix] (defaults to "yes"), |
8 |
>>> # otherwise echo [false output][false suffix] (defaults to "no"). |
9 |
>>> +if has "${EAPI:-0}" 0 1 2 3 4; then |
10 |
>>> usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963 |
11 |
>>> +fi |
12 |
>>> |
13 |
>>> # @FUNCTION: prune_libtool_files |
14 |
>>> # @USAGE: [--all] |
15 |
|
16 |
>> Looks good to me. |
17 |
|
18 |
>> It may not work for unofficial EAPIs that don't include usex, but I |
19 |
>> guess there's nothing we can do for those, and they can just be |
20 |
>> replaced with newer EAPIs that include usex. |
21 |
|
22 |
> Something like this would work with current versions of portage: |
23 |
|
24 |
> if ! declare -F usex >/dev/null ; then |
25 |
> usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } |
26 |
> fi |
27 |
|
28 |
> However, it's probably not a good idea to assume that the package |
29 |
> manager defines usex prior to sourcing the eclass. |
30 |
|
31 |
I agree, and I've replaced the declare -F by the explicit EAPI test |
32 |
from the above patch. |
33 |
|
34 |
Ulrich |