[pacman-dev] [PATCH] pkgdelta: fix improper passing of file argument

Dave Reisner dreisner at archlinux.org
Sat Mar 9 22:45:00 EST 2013


Looks like I hosed this pretty hard in 5a5e712c749edb8.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 scripts/pkgdelta.sh.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in
index a6aad3f..39046b8 100644
--- a/scripts/pkgdelta.sh.in
+++ b/scripts/pkgdelta.sh.in
@@ -75,6 +75,7 @@ isnumeric() {
 }
 
 read_pkginfo() {
+	unset pkgver pkgname arch
 	while IFS='=' read -r field value; do
 		# skip comments and invalid lines
 		[[ $field = '#'* || -z $value ]] && continue
@@ -82,10 +83,10 @@ read_pkginfo() {
 		# skip lines which aren't fields we care about
 		[[ $field != @(pkgver|pkgname|arch) ]] || continue
 
-		declare "$field=$value"
+		declare -g "${field% }=${value# }"
 
 		[[ $pkgname && $pkgver && $arch ]] && return 0
-	done
+	done < <(bsdtar -xOqf "$1" .PKGINFO 2>/dev/null)
 
 	error "$(gettext "Invalid package file '%s'.")" "$1"
 	return 1
-- 
1.8.1.5



More information about the pacman-dev mailing list