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:

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

Attachment: pgp4770BE4a4F.pgp
Description: PGP signature

Reply via email to