Makes sure the required package functions are present when using package
splitting.  Also moves setting of pkgbase variable outside the
check_sanity function to somewhere more appropriate.

Signed-off-by: Allan McRae <[email protected]>
---
 scripts/makepkg.sh.in |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 922187a..66287d0 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1134,9 +1134,6 @@ check_sanity() {
        if [ "$arch" = 'any' ]; then
                CARCH='any'
        fi
-
-       pkgbase=${pkgbase:-${pkgname[0]}}
-
        if ! in_array $CARCH ${ar...@]}; then
                if [ "$IGNOREARCH" -eq 0 ]; then
                        error "$(gettext "%s is not available for the '%s' 
architecture.")" "$pkgbase" "$CARCH"
@@ -1178,6 +1175,15 @@ check_sanity() {
                return 1
        fi
 
+       if [ "${#pkgna...@]}" -gt "1" ]; then
+               for pkg in ${pkgna...@]}; do
+                       if [ "$(type -t package_${pkg})" != "function" ]; then
+                               error "$(gettext "missing package function for 
split package '%s'")" "$pkg"
+                               return 1
+                       fi
+               done
+       fi
+
        return 0
 }
 
@@ -1653,6 +1659,8 @@ if [ "${#pkgna...@]}" -gt "1" ]; then
        SPLITPKG=1
 fi
 
+pkgbase=${pkgbase:-${pkgname[0]}}
+
 if [ "$SPLITPKG" -eq 0 ]; then
        if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
                        -a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" 
-eq 0 ]; then
-- 
1.6.3.3

_______________________________________________
pacman-dev mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/pacman-dev

Reply via email to