summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndres P <aepd87@gmail.com>2010-06-17 14:44:42 +0200
committerAllan McRae <allan@archlinux.org>2010-06-20 17:04:57 +0200
commit13748ca052975cbf6354cfc4554f49a3d8ff46fe (patch)
tree86deff794bee0105d07fbe5c6c99a0c39f6e2a21
parent34229c562571d458446c9e4da197fcae251c2f6b (diff)
downloadpacman-13748ca052975cbf6354cfc4554f49a3d8ff46fe.tar.gz
pacman-13748ca052975cbf6354cfc4554f49a3d8ff46fe.tar.xz
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>
-rw-r--r--scripts/makepkg.sh.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d0b8b4b7..28c7879e 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1260,7 +1260,7 @@ check_sanity() {
if (( ${#pkgname[@]} > 1 )); then
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"
return 1
fi
@@ -1769,12 +1769,12 @@ if (( ${#pkgname[@]} > 1 )); then
fi
# test for available PKGBUILD functions
-if [[ $(type -t build) = "function" ]]; then
+if declare -f build >/dev/null; then
BUILDFUNC=1
fi
-if [[ $(type -t package) = "function" ]]; then
+if declare -f package >/dev/null; then
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
fi