[pacman-dev] [PATCH 1/3] makepkg: Move .PKGINFO creation into a function.

Loui Chang louipc.ist at gmail.com
Fri Jun 19 14:33:08 EDT 2009


Signed-off-by: Loui Chang <louipc.ist at gmail.com>
---
 scripts/makepkg.sh.in |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 433fe34..d396480 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -871,22 +871,13 @@ tidy_install() {
 	fi
 }
 
-create_package() {
+write_pkginfo() {
 	if [ -z "$1" ]; then
 		nameofpkg="$pkgname"
 	else
 		nameofpkg="$1"
 	fi
 
-	if [ ! -d "$pkgdir" ]; then
-		error "$(gettext "Missing pkg/ directory.")"
-		plain "$(gettext "Aborting...")"
-		exit 1 # $E_MISSING_PKGDIR
-	fi
-
-	cd "$pkgdir"
-	msg "$(gettext "Creating package...")"
-
 	local builddate=$(date -u "+%s")
 	if [ -n "$PACKAGER" ]; then
 		local packager="$PACKAGER"
@@ -951,6 +942,19 @@ create_package() {
 			fi
 		fi
 	done
+}
+
+create_package() {
+	if [ ! -d "$pkgdir" ]; then
+		error "$(gettext "Missing pkg/ directory.")"
+		plain "$(gettext "Aborting...")"
+		exit 1 # $E_MISSING_PKGDIR
+	fi
+
+	write_pkginfo $@
+
+	cd "$pkgdir"
+	msg "$(gettext "Creating package...")"
 
 	# TODO maybe remove this at some point
 	# warn if license array is not present or empty
-- 
1.6.3.2



More information about the pacman-dev mailing list