Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2009-10-25 14:33:47 +1000
committerDan McGee <dan@archlinux.org>2009-11-15 19:29:24 -0600
commit9c34dfd908480baed06bb2e618d8899fb8728dbd (patch)
treee8b28d82b34abb5cd149e544b702586ed483f51b /scripts
parentc2999619d2af0c4fa3cbee13a4f12d95c6ab059e (diff)
makepkg: Add fallback to package function
makepkg looks for a package() function when building a single package but package_$pkgname() style package functions when building a split package. This patch allows the use of a package_$pkgname() function when building a single package for consistency. This is achieved by having makepkg consider a non-split package with a package_$pkgname() function as a split package (creating just the one package). Fixes FS#16622. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 25b1dfdc..47b1fd10 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1686,10 +1686,6 @@ if (( GENINTEG )); then
exit 0 # $E_OK
fi
-if [ "$(type -t package)" = "function" ]; then
- PKGFUNC=1
-fi
-
# check the PKGBUILD for some basic requirements
check_sanity || exit 1
@@ -1704,6 +1700,12 @@ if (( ${#pkgname[@]} > 1 )); then
SPLITPKG=1
fi
+if [ "$(type -t package)" = "function" ]; then
+ PKGFUNC=1
+elif [ $SPLITPKG -eq 0 -a "$(type -t package_${pkgname})" = "function" ]; then
+ SPLITPKG=1
+fi
+
pkgbase=${pkgbase:-${pkgname[0]}}
if (( ! SPLITPKG )); then