Make package_$pkgname a pointer to package() if it's not a split package.

Signed-off-by: Andres P <[email protected]>
---

Note that '[PATCH 09/10] makepkg: do not expand for loop variables twice' [1]
depends on this.

[1] Message-Id: [email protected]

 scripts/makepkg.sh.in |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index c770c7f..100ed6f 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1762,6 +1762,12 @@ if (( GENINTEG )); then
        exit 0 # $E_OK
 fi
 
+if (( ${#pkgna...@]} > 1 )); then
+       SPLITPKG=1
+else
+       eval 'package_'$pkgname'() { package; }'
+fi
+
 # check the PKGBUILD for some basic requirements
 check_sanity || exit 1
 
@@ -1772,10 +1778,6 @@ check_sanity || exit 1
 devel_check
 devel_update
 
-if (( ${#pkgna...@]} > 1 )); then
-       SPLITPKG=1
-fi
-
 # test for available PKGBUILD functions
 if declare -f build >/dev/null; then
        BUILDFUNC=1
-- 
1.7.1


Reply via email to