repo-add: handle lack of newline at end of .PKGINFO

Work around the final line not being parsed in .PKGINFO if there was a lack
of newline at the end of the file.  This could occur due to utilising a tool
other than makepkg to create packages.

The missed line created a difference in the parsing of .PKGINFO between
repo-add and pacman, causing packages to be seen as invalidwith pacman-6.1.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2024-04-13 22:45:57 +10:00
parent 7dcf9a2b49
commit 03d884d7ff

View file

@ -214,7 +214,7 @@ db_write_entry() {
# read info from the zipped package # read info from the zipped package
local line var val local line var val
while read -r line; do while read -r line || [[ -n $line ]]; do
[[ ${line:0:1} = '#' ]] && continue [[ ${line:0:1} = '#' ]] && continue
IFS=' =' read -r var val < <(printf '%s\n' "$line") IFS=' =' read -r var val < <(printf '%s\n' "$line")