summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndres P <aepd87@gmail.com>2010-06-25 18:46:40 -0430
committerDan McGee <dan@archlinux.org>2010-08-23 21:49:55 -0500
commitf27fed14b16dc85da104ae4c463ba6040d7e4d64 (patch)
tree893f44ce6ab8849562c77290dda401cdcdc0e8ed
parent298cbf2cb152df365a593a396266636a9d34355f (diff)
downloadpacman-f27fed14b16dc85da104ae4c463ba6040d7e4d64.tar.xz
makepkg: less code duplication in create_package
Combine changelog and install file creation in create_package(). Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in27
1 files changed, 12 insertions, 15 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2336e337..7ff4289b 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1007,21 +1007,18 @@ create_package() {
local comp_files=".PKGINFO"
- # check for an install script
- if [[ -n $install ]]; then
- msg2 "$(gettext "Adding install script...")"
- cp "$startdir/$install" .INSTALL
- chmod 644 .INSTALL
- comp_files="$comp_files .INSTALL"
- fi
-
- # do we have a changelog?
- if [[ -n $changelog ]]; then
- msg2 "$(gettext "Adding package changelog...")"
- cp "$startdir/$changelog" .CHANGELOG
- chmod 644 .CHANGELOG
- comp_files="$comp_files .CHANGELOG"
- fi
+ # check for changelog/install files
+ for i in 'changelog' 'install'; do
+ orig=${!i}
+ dest=$(tr '[:lower:]' '[:upper:]' <<<".$i")
+
+ if [[ -n $orig ]]; then
+ msg2 "$(gettext "Adding %s file...")" "$i"
+ cp "$startdir/$orig" "$dest"
+ chmod 644 "$dest"
+ comp_files+=" $dest"
+ fi
+ done
# tar it up
msg2 "$(gettext "Compressing package...")"