summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2009-06-22 02:04:44 -0400
committerAllan McRae <allan@archlinux.org>2009-06-22 17:09:16 +1000
commit01f9ae63e72a9bc41cccfef17d5c07673972f455 (patch)
treea42f4a44f9ab06a85e9319f0eaad89ed3066a276 /scripts/makepkg.sh.in
parent02acf65ef30048ba3c732628d30215467245e779 (diff)
downloadpacman-01f9ae63e72a9bc41cccfef17d5c07673972f455.tar.xz
makepkg: Move .PKGINFO creation into a function.
Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in36
1 files changed, 20 insertions, 16 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b555a031..2140ff09 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -871,22 +871,7 @@ tidy_install() {
fi
}
-create_package() {
- 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...")"
-
+write_pkginfo() {
local builddate=$(date -u "+%s")
if [ -n "$PACKAGER" ]; then
local packager="$PACKAGER"
@@ -958,6 +943,25 @@ create_package() {
warning "$(gettext "Please add a license line to your %s!")" "$BUILDSCRIPT"
plain "$(gettext "Example for GPL\'ed software: license=('GPL').")"
fi
+}
+
+create_package() {
+ if [ ! -d "$pkgdir" ]; then
+ error "$(gettext "Missing pkg/ directory.")"
+ plain "$(gettext "Aborting...")"
+ exit 1 # $E_MISSING_PKGDIR
+ fi
+
+ if [ -z "$1" ]; then
+ nameofpkg="$pkgname"
+ else
+ nameofpkg="$1"
+ fi
+
+ write_pkginfo $nameofpkg
+
+ cd "$pkgdir"
+ msg "$(gettext "Creating package...")"
local comp_files=".PKGINFO"