mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
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>
This commit is contained in:
parent
298cbf2cb1
commit
f27fed14b1
@ -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
|
||||
# check for changelog/install files
|
||||
for i in 'changelog' 'install'; do
|
||||
orig=${!i}
|
||||
dest=$(tr '[:lower:]' '[:upper:]' <<<".$i")
|
||||
|
||||
# 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
|
||||
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...")"
|
||||
|
Loading…
Reference in New Issue
Block a user