On Tue, Mar 31, 2009 at 11:05 AM, Donnie Berkholz <dberkh...@gentoo.org> wrote:
> I noticed some eclass commits using java-pkg_func-exists() and it's a
> lot more complicated than it needs to me. Perhaps not everybody knows
> that bash generally gives a return status from functions of the last
> command run in that function. So these two things are equivalent:

Also worst feature ever, Ruby does it too and it sucks :)

>
> java-pkg_func-exists() {
>    if [[ -n "$(declare -f ${1})" ]]; then
>        return 0
>    else
>        return 1
>    fi
> }
>
>
> java-pkg_func-exists() {
>    [[ -n "$(declare -f ${1})" ]]
> }
>
>
> --
> Thanks,
> Donnie
>
> Donnie Berkholz
> Developer, Gentoo Linux
> Blog: http://dberkholz.wordpress.com
>

Reply via email to