[pacman-dev] [PATCH 11/11] makepkg: small step in unifying split/single package logic

Andres P aepd87 at gmail.com
Fri Jun 25 19:43:17 EDT 2010


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

Signed-off-by: Andres P <aepd87 at gmail.com>
---

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

[1] Message-Id: 1277507805-22149-9-git-send-email-aepd87 at gmail.com

 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 (( ${#pkgname[@]} > 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 (( ${#pkgname[@]} > 1 )); then
-	SPLITPKG=1
-fi
-
 # test for available PKGBUILD functions
 if declare -f build >/dev/null; then
 	BUILDFUNC=1
-- 
1.7.1



More information about the pacman-dev mailing list