1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-15 13:55:09 -05:00

makepkg: use "declare -f" to test for function presence

Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andres P 2010-06-17 08:14:42 -04:30 committed by Allan McRae
parent 34229c5625
commit 13748ca052

View File

@ -1260,7 +1260,7 @@ check_sanity() {
if (( ${#pkgname[@]} > 1 )); then if (( ${#pkgname[@]} > 1 )); then
for pkg in ${pkgname[@]}; do for pkg in ${pkgname[@]}; do
if [[ $(type -t package_${pkg}) != "function" ]]; then if declare -f package_${pkg} >/dev/null; then
error "$(gettext "missing package function for split package '%s'")" "$pkg" error "$(gettext "missing package function for split package '%s'")" "$pkg"
return 1 return 1
fi fi
@ -1769,12 +1769,12 @@ if (( ${#pkgname[@]} > 1 )); then
fi fi
# test for available PKGBUILD functions # test for available PKGBUILD functions
if [[ $(type -t build) = "function" ]]; then if declare -f build >/dev/null; then
BUILDFUNC=1 BUILDFUNC=1
fi fi
if [[ $(type -t package) = "function" ]]; then if declare -f package >/dev/null; then
PKGFUNC=1 PKGFUNC=1
elif [[ $SPLITPKG -eq 0 && $(type -t package_${pkgname}) = "function" ]]; then elif [[ $SPLITPKG -eq 0 ]] && declare -f package_${pkgname} >/dev/null; then
SPLITPKG=1 SPLITPKG=1
fi fi