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
1 changed files with 11 additions and 14 deletions
|
@ -1007,21 +1007,18 @@ create_package() {
|
||||||
|
|
||||||
local comp_files=".PKGINFO"
|
local comp_files=".PKGINFO"
|
||||||
|
|
||||||
# check for an install script
|
# check for changelog/install files
|
||||||
if [[ -n $install ]]; then
|
for i in 'changelog' 'install'; do
|
||||||
msg2 "$(gettext "Adding install script...")"
|
orig=${!i}
|
||||||
cp "$startdir/$install" .INSTALL
|
dest=$(tr '[:lower:]' '[:upper:]' <<<".$i")
|
||||||
chmod 644 .INSTALL
|
|
||||||
comp_files="$comp_files .INSTALL"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# do we have a changelog?
|
if [[ -n $orig ]]; then
|
||||||
if [[ -n $changelog ]]; then
|
msg2 "$(gettext "Adding %s file...")" "$i"
|
||||||
msg2 "$(gettext "Adding package changelog...")"
|
cp "$startdir/$orig" "$dest"
|
||||||
cp "$startdir/$changelog" .CHANGELOG
|
chmod 644 "$dest"
|
||||||
chmod 644 .CHANGELOG
|
comp_files+=" $dest"
|
||||||
comp_files="$comp_files .CHANGELOG"
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# tar it up
|
# tar it up
|
||||||
msg2 "$(gettext "Compressing package...")"
|
msg2 "$(gettext "Compressing package...")"
|
||||||
|
|
Loading…
Add table
Reference in a new issue