makepkg: use double brackets

Change all instances of the (test) [ builtin to the [[ keyword.

Signed-off-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andres P 2010-05-26 11:35:40 -04:30 committed by Allan McRae
parent 95145d4c52
commit f258ffab25

View file

@ -1273,7 +1273,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 [[ $(type -t package_${pkg}) != "function" ]]; 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
@ -1782,14 +1782,12 @@ if (( ${#pkgname[@]} > 1 )); then
fi fi
# test for available PKGBUILD functions # test for available PKGBUILD functions
# The exclamation mark is required here to avoid triggering the ERR trap when if [[ $(type -t build) = "function" ]]; then
# a tested function does not exist.
if [[ $(! type -t build) = "function" ]]; then
BUILDFUNC=1 BUILDFUNC=1
fi fi
if [ "$(type -t package)" = "function" ]; then if [[ $(type -t package) = "function" ]]; then
PKGFUNC=1 PKGFUNC=1
elif [ $SPLITPKG -eq 0 -a "$(type -t package_${pkgname})" = "function" ]; then elif [[ $SPLITPKG -eq 0 && $(type -t package_${pkgname}) = "function" ]]; then
SPLITPKG=1 SPLITPKG=1
fi fi