mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
makepkg: check for package functions when package splitting
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 <allan@archlinux.org>
This commit is contained in:
parent
e72cce352a
commit
6092dda177
@ -1135,9 +1135,6 @@ check_sanity() {
|
|||||||
if [ "$arch" = 'any' ]; then
|
if [ "$arch" = 'any' ]; then
|
||||||
CARCH='any'
|
CARCH='any'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pkgbase=${pkgbase:-${pkgname[0]}}
|
|
||||||
|
|
||||||
if ! in_array $CARCH ${arch[@]}; then
|
if ! in_array $CARCH ${arch[@]}; then
|
||||||
if [ "$IGNOREARCH" -eq 0 ]; then
|
if [ "$IGNOREARCH" -eq 0 ]; then
|
||||||
error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgbase" "$CARCH"
|
error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgbase" "$CARCH"
|
||||||
@ -1179,6 +1176,15 @@ check_sanity() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${#pkgname[@]}" -gt "1" ]; then
|
||||||
|
for pkg in ${pkgname[@]}; 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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1655,6 +1661,8 @@ if [ "${#pkgname[@]}" -gt "1" ]; then
|
|||||||
SPLITPKG=1
|
SPLITPKG=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pkgbase=${pkgbase:-${pkgname[0]}}
|
||||||
|
|
||||||
if [ "$SPLITPKG" -eq 0 ]; then
|
if [ "$SPLITPKG" -eq 0 ]; then
|
||||||
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
|
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
|
||||||
-a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then
|
-a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user