>>>>> On Thu, 27 Sep 2012, Zac Medico wrote:

>>> --- eutils.eclass   15 Sep 2012 16:16:53 -0000      1.403
>>> +++ eutils.eclass   27 Sep 2012 16:45:14 -0000
>>> @@ -1373,7 +1373,9 @@
>>>  # @DESCRIPTION:
>>>  # If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
>>>  # otherwise echo [false output][false suffix] (defaults to "no").
>>> +if has "${EAPI:-0}" 0 1 2 3 4; then
>>>  usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963
>>> +fi
>>>  
>>>  # @FUNCTION: prune_libtool_files
>>>  # @USAGE: [--all]

>> Looks good to me.

>> It may not work for unofficial EAPIs that don't include usex, but I
>> guess there's nothing we can do for those, and they can just be
>> replaced with newer EAPIs that include usex.

> Something like this would work with current versions of portage:

> if ! declare -F usex >/dev/null ; then
>    usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; }
> fi

> However, it's probably not a good idea to assume that the package
> manager defines usex prior to sourcing the eclass.

I agree, and I've replaced the declare -F by the explicit EAPI test
from the above patch.

Ulrich

Reply via email to