From abec6bc1395da085cc3e8aadc5b02da9bdd67f58 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 13 Apr 2024 22:45:57 +1000 Subject: [PATCH] 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 (cherry picked from commit 03d884d7ff43a474c1670db3cbbf1fbbef2926df) --- scripts/repo-add.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 39137f97..4656f270 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -214,7 +214,7 @@ db_write_entry() { # read info from the zipped package local line var val - while read -r line; do + while read -r line || [[ -n $line ]]; do [[ ${line:0:1} = '#' ]] && continue IFS=' =' read -r var val < <(printf '%s\n' "$line")